Commit Graph

83 Commits (9e181ca8f446d238ba279bc22fef9d166d4f38b0)

Author SHA1 Message Date
Gabriel Scherer 7068266b32 Typemod.merge_constraint: be careful about the typing environments
This PR fixes an old bug in the interaction between [merge_constraint]
and [Typedecl.transl_with_constraint], where
variance (and now separability) are recomputed in an invalid type
environment. See #9624 and the new tests.
2020-06-03 14:33:50 +02:00
Rodolphe Lepigre 15a6ff229d typedecl: use the new Separability implementation, remove old code
Because this changes the separability of standard library types, and
those separabilities are stored in the .cmi files, this commit changes
the .cmi files in the standard libraries in way that appear to require
a bootstrap (it looks like some part of the stdlib is built with
boot/ocamlc and others with ocamlc, and the two should produce/expect
the same .cmi exactly). The bootstrap will come as a separate commit.
2020-01-28 12:09:33 +01:00
Florian Angeletti ee32976da1 reworded errors for non-regular structural types
* explicitly mention that the type definition is non-regular
* avoid implicit permutation in type parameters
* don't try to propose a "fix"
2019-10-30 10:02:31 +01:00
Jacques Garrigue 4fe08b25d6
Fix #7851 by checking type declaration coherence for recursive modules (#8570) 2019-04-19 10:57:55 +09:00
Rodolphe Lepigre ca227428f4 Typedecl: split immediacy to a separate unit Typedecl_variance
get_unboxed_type_representation is used in several other modules, and
split into its own Typedecl_unboxed unit.

(pair-programming with Gabriel Scherer)
2018-11-23 12:05:33 +01:00
Gabriel Scherer 24ea989c02 Typedecl: split variance to a separate unit Typedecl_variance
(pair-programming with Rodolphe Lepigre)
2018-11-23 12:05:33 +01:00
Gabriel Scherer 000795890e rename Typedecl.compute_variance_decls into compute_variance_class_decls 2018-11-18 14:53:52 +01:00
Florian Angeletti 3de40984ba a type for unification traces 2018-10-17 17:27:16 +02:00
Thomas Refis c00a46e2cf more precise extension mismatch error messages 2018-08-09 10:18:54 +01:00
Hugo Heuzard 7835cbb9bd Add tests for attributes
fix style
2018-04-09 22:29:46 +01:00
Hugo Heuzard 002815c4bb allow to attach @@ attributes on exceptions 2018-04-09 22:29:46 +01:00
Leo White d41c41c172 Add private extensible variants 2017-09-11 13:29:56 +01:00
Jacques Garrigue f9008883a6 Fix PR#6934 2017-03-16 08:34:10 +09:00
Damien Doligez d5a6e50ebe GPR#606: add unboxed types 2016-07-21 13:51:46 +02:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Will Crichton 50dd38d4b6 Add support for immediate attribute 2016-02-02 11:45:07 +00:00
Marc Lasson 934dd9a40b More errors with unboxed and untagged attributes
This commit adds errors for bad uses of @untagged and
@unboxed attributes in external declarations.

There are three possible new errors:
  - One when the external does not contain a native version of
the primitive,
  - One when the attribute occurs deeply into the type,
  - One when the attribute is applied to the whole function type.
2016-01-20 11:51:26 +01:00
Jérémie Dimino d24221cb5f Use Attr_helper in typing/typedecl.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16452 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:18 +00:00
Jérémie Dimino 1d196f4ddd Support [@unboxed] and [@untagged] attributes
Adding [@unboxed] (resp [@untagged]) on a primitive argument means
that the argument must passed unboxed (resp untagged) to the external
function. Adding [@unboxed] (resp [@untagged]) on the result means
that the external function returns its result unboxed (resp untagged).

The unboxing (resp untagging) method is derived from the type.

Currently unboxing is suported for: float, int32, int64 and nativeint.
Untagging is supported for int.

This patch also increases the cm{i,o,a,x,xa} magic numbers as the type
Primitive.description is changed.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 16:18:46 +00:00
Jérémie Dimino 65e605a7f2 Support non-recursive types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15921 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:08:30 +00:00
Alain Frisch a033839139 #6688: allow val declarations as structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15645 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-10 13:37:50 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Jacques Garrigue b56dc4b3df PR#5584: merge open extensible types, extension-patch-4.0.2
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00
Damien Doligez 0cba565437 fix some whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14680 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 22:34:13 +00:00
Alain Frisch 3b6c0c88a5 Make Parsetree more uniform by keeping locations in all records which have attributes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14659 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:28:20 +00:00
Alain Frisch 6fe5dd7cf4 Turn more sig/str items into records. Patch from Leo White.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14597 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:26:00 +00:00
Alain Frisch 525ef9d703 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Jacques Garrigue e2dbb7f516 Fix PR#6005
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13647 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-03 14:40:11 +00:00
Jacques Garrigue c425ae1ce8 Fix PR#5985; compute injectivity of types but no new syntax
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13634 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-30 05:26:57 +00:00
Alain Frisch 77d3fce857 Align exception_declaration with Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13446 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:42:45 +00:00
Alain Frisch f4ca2da467 Align type_declaration with parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:20:11 +00:00
Alain Frisch 25815e6e77 Align typed value_declaration with parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:04:40 +00:00
Alain Frisch 0b9347f482 Represent exception declarations as constructor declarations in the Parsetree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 15:49:10 +00:00
Alain Frisch 241abe55e6 Type name is part of the type declaration record.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13356 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 11:47:59 +00:00
Jacques Garrigue 26e1ff7138 Merge short-paths into a fresh branch of trunk.
Also fix a bit unification and subtyping errors.
You now need the flag -short-path to activate short paths.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths-4.01@13285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-29 14:21:12 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Jacques Garrigue 35185d610b merge version/4.00 at revision 12866
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-21 07:10:35 +00:00
Jacques Garrigue d8f8f9ee3b keep the text width to 80 columns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-31 08:07:31 +00:00
Fabrice Le Fessant d39d43e55f merge with branch bin-annot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-30 14:52:37 +00:00
Alain Frisch f0b95f3349 Keep locations for exception declaration. This gives better error messages and paves the way to #5524.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12193 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-06 19:03:17 +00:00
Jacques Garrigue 50de05d31d first attempt: handles only unification errors
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-22 03:15:14 +00:00
Jacques Garrigue b1f8048f39 merge branches/located_errors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11228 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-10-21 03:26:35 +00:00
Jacques Garrigue 9dc661c3bf merge branches/gadts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-29 10:32:43 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Damien Doligez c91db736b1 merge changes from 3.12.0 to 3.12.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-20 09:17:07 +00:00
Jacques Garrigue f368f4e0d5 allow variance in GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadts@10763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-11-08 06:59:46 +00:00
Jacques Le Normand a1910000e3 fixed bug in syntax extension. Made unification of variants and objects local. Removed personal comments
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadts@10724 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-10-19 05:24:36 +00:00
Jacques Garrigue 1772822057 PR#4478: better error messages for type definition mismatches
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-05-21 03:36:52 +00:00
Jacques Garrigue 80b48b7a69 make duplicate definitions a warning rather than an error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-04-30 06:26:51 +00:00