Commit Graph

1684 Commits (d07c0698d0747d9a3a3f7bb7c8a2f3fea7800e59)

Author SHA1 Message Date
Jacques Garrigue 00e7279141 Fix PR#6836: Assertion failure using -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-13 07:17:22 +00:00
Damien Doligez 53d553112b PR#6827: prefer string to bytes with -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15987 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-07 18:49:50 +00:00
Fabrice Le Fessant ccfec3a1dc Add location info on Tcoerce_primitive
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15984 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-03 16:40:24 +00:00
Damien Doligez 6564974ee9 fix bug reported in https://github.com/ocaml/ocaml/pull/149
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15968 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-26 16:43:43 +00:00
Jacques Garrigue 4650c62f8b wrong commit
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15965 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-26 02:04:22 +00:00
Jacques Garrigue aa5422cdeb Fix PR#5545, cleaner use of generalize_spine
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-25 23:25:52 +00:00
Jacques Garrigue d2bed28077 Fix PR#6817
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15959 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-25 01:49:07 +00:00
Jérémie Dimino 6552e6df8d Fix printing of nonrec types
By allowing Trec_next after Trec_not. Also renamed some functions with
more explicit names:
- map_rec'  -> map_rec_type
- map_Rec'' -> map_rec_type_with_row_types


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15943 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-16 17:41:56 +00:00
Jérémie Dimino 321e95804c Fix printing of sequence of type delcarations with -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15942 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-16 17:38:38 +00:00
Jérémie Dimino a700f40252 Update printing of nonrec types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15924 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:09:19 +00:00
Jérémie Dimino bcc9e6adfa Update ocamldoc and other utilities to support "type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15923 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:09:08 +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
Jérémie Dimino 51ba396328 Add rec_flag to type items in the parsetree and typedtree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15918 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:07:29 +00:00
Jacques Garrigue 73756628c0 fix PR#6812
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15917 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 03:58:38 +00:00
Alain Frisch 11333d938c #6583: support for custom #... binary operators (also allowing '#' in trailing symbols, although the operator is then rejected by the type-checker).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15892 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-09 17:39:50 +00:00
Gabriel Scherer 1ecdd68c21 untypeast: small change to avoid producing new compiler warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15889 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:37 +00:00
Gabriel Scherer ad85a8c1df use open recursion in untypeast.ml
This allows library user to override the untyping behavior of specific
typedtree nodes.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15888 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:35 +00:00
Gabriel Scherer 786e69e846 move tools/untypeast.ml to typing/untypeast.ml
This makes them available in compiler-libs, enabling various uses
outside the compiler.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15886 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:32 +00:00
Gabriel Scherer 3ad7f526a2 PR#6452, GPR#140: add internal support for custom printing formats
(Jérémie Dimino)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15884 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 09:36:10 +00:00
Jacques Garrigue 22a3f9fc16 Fix PR#6787
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15851 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-19 09:57:41 +00:00
Jacques Garrigue a5252548c6 Fix PR#6768: Typechecker overflow the stack on cyclic type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-05 07:47:14 +00:00
Jacques Garrigue 410a8b599d Fix PR#6752: scope escaping due to reference inside a module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15783 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 03:58:11 +00:00
Jacques Garrigue 21bec6fb4b Fix PR#6171: Error message confusing for the beginner when a type escapes its scope.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 03:26:54 +00:00
Jacques Garrigue 1bb0491e64 partial fix of PR#6744
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15781 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 00:44:02 +00:00
Jacques Garrigue 64ee2135de Resolve PR#6742: remove duplicate virtual_flag information from Tstr_class
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15776 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-16 09:20:13 +00:00
Jacques Garrigue 838d099258 PR#6600: make -short-paths faster by building the printing map incrementally
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15775 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-16 02:04:17 +00:00
Alain Frisch 6f2bb2922c Fix #6748 (bug in tast_iter, some module coercions were not rewritten).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15773 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-15 11:59:18 +00:00
Alain Frisch 6e85c2d956 #6737: also keep attribute with optional argument + default value.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15764 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-06 11:16:23 +00:00
Alain Frisch 8a2030cff1 #6737: fix typedtree attributes on (fun x -> body) expressions).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-06 11:02:17 +00:00
Gabriel Scherer 055d5ff07f PR#6714: allow [@@ocaml.warning] on most structure and signature items (values, modules, module types)
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15752 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-27 08:44:50 +00:00
Alain Frisch 9d450a05e0 Replace TypedtreeMap with a more standard open-recursion iterator Tast_mapper. Keep TypedtreeMap/Iter for now, for external projects.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15739 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 09:36:41 +00:00
Jacques Garrigue 93bae0cc3a Exhauce PR#6611: remove the option wrapper on optional arguments in the syntax tree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 09:06:02 +00:00
Jacques Garrigue 158480371a exhauce PR#6367: introduce Asttypes.arg_label to encode labelled arguments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 08:45:55 +00:00
Gabriel Scherer f15f4f3ed8 PR6695: Make sure the compiler only uses ASCII string functions.
This should cover all places involving filenames in the compiler.
There are a few more paths still using Latin-1 in other ways,
e.g. in ocamldoc.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15727 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:14 +00:00
Gabriel Scherer 4c5c124785 PR#6466: use "extensible variant" rather than "open" types in error message
(Leo White)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15715 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 08:26:18 +00:00
Gabriel Scherer 1e411a376b Fix constructor names in Typedast printing.
From: Drup <drupyog@zoho.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15682 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:38 +00:00
Jacques Garrigue 583395b0c6 Fix PR#6726: Access to the wrong field of aliased module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15681 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 07:20:00 +00:00
Jacques Garrigue ac6c857df4 add comment for Tobject in Datarepr.free_vars
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15676 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 01:48:09 +00:00
Jacques Garrigue fd2e5d7a52 Fix PR#6716: Assertion failure with existentials + inline records + rows
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15675 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 01:37:44 +00:00
Gabriel Scherer f33c14b278 'Did you mean' for instance variables
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15655 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:29 +00:00
Gabriel Scherer bbf039706a 'Did you mean' for unbound method names
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15654 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:27 +00:00
Gabriel Scherer 7a97cb4f72 typecore.ml: minor refactoring
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15653 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:25 +00:00
Gabriel Scherer b6c2247a45 simplify spellchecking of labels in typecore.ml:
By computing the list of valid names at Wrong_name raising point, we
can remove the logic to reconstruct the set of valid names to draw
suggestion from after the fact:
- no spellchecking-related code in the NameChoice functor
- seamlessly extends to fields of inline records (were not spellchecked before)

I made the type of the "wrong name" in the Wrong_name exception more
precise, from Longident.t to string. The rationale is that:
- we only raise this exception when the longident happens to be
  a (Lident str)
- the list of valid names is a list of field or variant names; those
  are strings rather than idents

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15652 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:24 +00:00
Gabriel Scherer 3e7c17695c 'Did you mean' for variables missing on one side of an or-pattern
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15651 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:22 +00:00
Gabriel Scherer 843f152505 simplify the spellcheck functions
- expose the core spellchecking functionality in Misc rather than Typetexp
- remove the too high-order (yet insufficiently parametric)
  Typetexp.spellcheck from the public interface
- rewrite the spellchecking functions for variants and fields in
  Typecore from the Misc functions rather than reusing
  Typetexp.spellcheck

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:16 +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
Jacques Garrigue 7a52c110b4 Fix PR#6680
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15640 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-08 08:10:55 +00:00
Jacques Garrigue 1453740778 fix PR#6690
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15637 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-08 07:51:10 +00:00
Alain Frisch 77bc51fb82 Avoid an index-out-of-bound fatal error when the primitive name is empty.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15621 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-03 09:40:27 +00:00
Gabriel Scherer 7bacc5beb4 Typedtree: add type information to primitive coercions
This will enable type-directed optimizations during translation of
module coercions.

WARNING: this breaks Typedtree representation, magic number will have to
be adjusted.

From: Frederic Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-17 11:55:24 +00:00
Jacques Garrigue dcb6a4dd7e tentative fix of PR#6651
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15576 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-12 11:59:23 +00:00
Jacques Garrigue 18ed39fb36 Fix PR#6650: Cty_constr not handled correctly by Subst
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15574 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-10 09:43:30 +00:00
Jacques Garrigue 5adbb67a45 PR#6648: show_module should indicate its elision (add Osig_ellipsis to outcometree)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15573 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-10 09:09:23 +00:00
Damien Doligez 94dfb61c09 fix a bug where the .annot files were truncated because of a missing "close"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-29 21:18:14 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Alain Frisch e3ad818fb5 Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-14 15:51:30 +00:00
Alain Frisch af330ed939 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:49:39 +00:00
Alain Frisch fbc0356199 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:40:06 +00:00
Alain Frisch 50e0458bc9 Fix.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:32:47 +00:00
Alain Frisch 1abf8e25be Better error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15504 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:30:32 +00:00
Alain Frisch 2a4e45404e Text.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15503 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:28:56 +00:00
Alain Frisch bf7fc7ddd3 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15501 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:15:18 +00:00
Alain Frisch f66fe1d196 Move constructor and label description records to the bottom of Types. Conceptually those records don't belong to the type language, and could very well be declared e.g. in Datarepr instead.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:09:34 +00:00
Alain Frisch 5d66f846ca Improve error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15494 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 16:08:06 +00:00
Alain Frisch 0f70276225 Reduce diff with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15493 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 15:56:39 +00:00
Alain Frisch c69e6d10d2 Reduce diff with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15492 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 15:56:20 +00:00
Alain Frisch 7d53335538 Stop propagating manifest on inlined record types created by rebinding of extension constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 13:57:19 +00:00
Alain Frisch 44e21907a0 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15489 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 10:36:14 +00:00
Alain Frisch f87ab66c09 Simplify removal of duplicated values in signatures, reusing the same code as for structures (instead of duplicating the logic; also getting rid of a quadratic algorithm).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15488 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 10:31:15 +00:00
Alain Frisch e1eddd80ed Disallow completely inline records on GADT constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 07:36:21 +00:00
Alain Frisch ad32b4dcee Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15460 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:59:45 +00:00
Alain Frisch 37f4743986 Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15459 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:59:37 +00:00
Alain Frisch d8c418d1cc Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15457 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:32:08 +00:00
Alain Frisch 808d3de148 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:30:39 +00:00
Alain Frisch 0b2745ed8c Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15454 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:26:58 +00:00
Alain Frisch 02bfe9c1ec Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15453 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:24:50 +00:00
Alain Frisch 3fbf73839d Sync with trunk + cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15452 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:17:45 +00:00
Alain Frisch 7ba65eb8eb Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15451 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:16:45 +00:00
Alain Frisch 7a21fae1a7 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:26:11 +00:00
Alain Frisch 9739923fca Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:19:59 +00:00
Alain Frisch 5d0a491e56 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:14:17 +00:00
Alain Frisch f7506d81df Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15441 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:13:36 +00:00
Alain Frisch 79e0a4e3e6 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15440 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:04:10 +00:00
Alain Frisch cb01d1c89f Cleanup detection of duplicated type/... names.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15439 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 12:03:05 +00:00
Alain Frisch 399faa65e9 Reduce diff.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15438 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:57:43 +00:00
Alain Frisch bafd443248 Reduce diff.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15437 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:51:53 +00:00
Alain Frisch 997ba44234 Reduce diff.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15436 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:49:22 +00:00
Alain Frisch 3ad9891e54 Reduce diff.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15435 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:48:44 +00:00
Alain Frisch f56b5bcf1b Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15434 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:46:21 +00:00
Alain Frisch 64d170354c Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15433 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:45:23 +00:00
Alain Frisch 84fc597314 Reduce diff.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15432 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:41:56 +00:00
Alain Frisch 84fb49c665 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15431 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:38:38 +00:00
Alain Frisch 4bd0d66cac Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15430 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:30:59 +00:00
Alain Frisch d5583e22fb Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15429 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:29:58 +00:00
Alain Frisch c04726c215 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15428 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:17:20 +00:00
Alain Frisch e0548c2ba2 Simplify: the inlined information does not need to be stored with type_descriptions.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15427 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 11:12:43 +00:00
Alain Frisch c341891a95 Change the definition of type parameters for the inline record types: for non-GADT constructors, we use the same type parameters as the sum type; for GADT constructors, we support for now only the case with 0 or 1 free variables in the record, and we use this list as type parameters (ordering is canonical). Support for GADT constructors with more than one free variables can be added later when a proper syntax is added to specify the ordered list of type variables.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15426 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 09:49:32 +00:00
Alain Frisch 90662da521 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15425 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 09:06:07 +00:00
Alain Frisch c767b9a299 Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15424 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 09:03:11 +00:00
Alain Frisch c0d246224a Integrate simple change from constructors_with_record4.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:58:06 +00:00
Alain Frisch 8ce82e2f63 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:51:15 +00:00
Alain Frisch a071918419 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15421 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:50:34 +00:00
Alain Frisch 70d201c968 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15420 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:47:44 +00:00
Alain Frisch 58cede37c8 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15419 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:46:21 +00:00
Alain Frisch f425cc7849 Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15418 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 08:38:18 +00:00
Jacques Garrigue 67f3768100 Fix PR#6593: Functor application in tests/basic-modules fails
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15413 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-02 00:43:01 +00:00
Alain Frisch c820a813d7 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15410 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 14:22:05 +00:00
Alain Frisch 8feec4d2aa The path under Tpackage doesn't refer to a type path (but to a module type path).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15409 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 12:31:24 +00:00
Alain Frisch 0508ce34f8 Proper error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15408 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 10:57:01 +00:00
Alain Frisch 3e4ecd96a4 Support referencing inline record types defined by the current type definition.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15407 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 10:47:19 +00:00
Jacques Garrigue e757455115 Fix PR#6465: allow incremental weakening of module aliases
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15405 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-01 09:07:14 +00:00
Alain Frisch 5afa84fdb8 Get rif of multiple exceptions with the same name in the same module.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15384 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 13:18:41 +00:00
Alain Frisch d4cb9063f1 Do not resolve Tpackage path with find_type (to be checked).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 13:09:34 +00:00
Alain Frisch aa2b9cbbdb Print inlined record type with a bang.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15381 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 12:43:17 +00:00
Alain Frisch a07fa4c556 Reduce diff with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15379 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 12:23:11 +00:00
Alain Frisch f7aea9bb53 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15378 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 12:17:03 +00:00
Alain Frisch 186847547f No need to track extension path in record_representation, infer it from the result type of the label.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15377 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 11:10:43 +00:00
Alain Frisch d19a43be70 Re-enable rebinding of extension constructors with inlined records.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15376 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 10:51:25 +00:00
Alain Frisch 5b9538aa3d Support for inlined records in extension constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15375 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 10:41:39 +00:00
Alain Frisch 4c378dc444 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 09:32:55 +00:00
Alain Frisch 26f6d39bb5 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15373 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 08:42:04 +00:00
Alain Frisch d1b95e90fe Towards sugar-less encoding of constructor types.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 08:37:55 +00:00
Alain Frisch 6b080e669e Towards getting rid of the internal syntactic sugar.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15371 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-29 16:19:00 +00:00
Alain Frisch 6ca707d066 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-29 14:06:20 +00:00
Alain Frisch e8fd41e2e8 Get rid of type-qualifed constructor paths for extensible types.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 16:25:29 +00:00
Alain Frisch 1f203ae846 Disallow multiple declaration of extension constructors with the same name in the same module.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 15:34:06 +00:00
Alain Frisch 1fb70280aa Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15348 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:46:54 +00:00
Alain Frisch 627dda3c43 Merge with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15347 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:35:29 +00:00
Alain Frisch eb893a5605 Fix merge problem.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15346 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:32:59 +00:00
Alain Frisch bd9c17c8d5 Make it clear that type-qualified constructors are only allowed in bang types.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25 15:22:06 +00:00
Alain Frisch 5dac90505f Allow qualified reference to constructors (at least in bang-types). A regular variant type supports qualified constructors of the form: M.t.X. An extensible variant type supports qualified constructors of the form: M.t.N.X.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25 15:16:19 +00:00
Alain Frisch 4aa48476d8 Refer to the inlined record type as !M.Foo for a constructor M.Foo.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23 16:06:09 +00:00
Alain Frisch 1701d2733b #5528: factorize the generation of names for inlined records.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-05 12:24:31 +00:00
Alain Frisch 378a967cb7 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-04 16:11:12 +00:00
Alain Frisch 2cf427beb3 #6529: the checked flag is now part of pers_struct.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15174 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 12:28:48 +00:00
Alain Frisch adcd0fe5c9 #6529: further optimize consistency check.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 08:36:47 +00:00
Damien Doligez a18bc7950b merge changes of version/4.02 from r15121 to r15155
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-29 17:14:00 +00:00
Gabriel Scherer d875804d9c fix minor error-reporting bug
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15141 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-28 21:52:00 +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
Alain Frisch 67151820dc #5528: type extensions can create local type names t.A without an explicit local type t (if the extended type is non-local). We must thus check explicitly uniqueness of synthesized type names t.A instead of relying on uniqueness of declared types as before (well, we already had the problem if someone redefined a local exn type).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15083 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 15:40:52 +00:00
Alain Frisch b115e37fc8 #5528: improve error reporting.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15081 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:57:13 +00:00
Alain Frisch 9fce02d524 #5528: improve error reporting.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15080 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:41:50 +00:00
Alain Frisch 9dcd1459fe #5528: support rebinding inlined extension constructors with free variables.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15079 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:32:23 +00:00
Alain Frisch bfba47f922 Cherry pick 15071 from 4.02 (Fix #6510: Removal of shadowed constructors of extensible types can break the structure of definitions).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15072 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-08 12:17:34 +00:00
Alain Frisch 50f47df33a Sync with trunk. Rebinding of inlined extension constructors with free variables is not yet supported.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 16:07:55 +00:00
Gabriel Scherer d59a10413f PR#6474: fix the "weak dependencies" support (patch by Leo White)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-06 11:39:21 +00:00
Gabriel Scherer 49d3f7b9f8 PR#6418: support "@[<hov %d>" in the new format implementation (Benoît Vaugon)
The bootstrap procedure, as for commit trunk@14973 (see there for
detailed build instructions), requires to first commit a temporary
patch:

> diff -Naur old/typing/typecore.ml new/typing/typecore.ml
> --- old/typing/typecore.ml        2014-06-11 18:16:24.851647309 +0200
> +++ new/typing/typecore.ml        2014-06-11 18:15:50.075646418 +0200
> @@ -2758,16 +2758,9 @@
>        let mk_int n = mk_cst (Const_int n)
>        and mk_string str = mk_cst (Const_string (str, None))
>        and mk_char chr = mk_cst (Const_char chr) in
> -      let mk_block_type bty = match bty with
> -        | Pp_hbox   -> mk_constr "Pp_hbox"   []
> -        | Pp_vbox   -> mk_constr "Pp_vbox"   []
> -        | Pp_hvbox  -> mk_constr "Pp_hvbox"  []
> -        | Pp_hovbox -> mk_constr "Pp_hovbox" []
> -        | Pp_box    -> mk_constr "Pp_box"    []
> -        | Pp_fits   -> mk_constr "Pp_fits"   [] in
>        let rec mk_formatting_lit fmting = match fmting with
> -        | Open_box (org, bty, idt) ->
> -          mk_constr "Open_box" [ mk_string org; mk_block_type bty; mk_int idt ]
> +        | Open_box _ ->
> +          assert false
>          | Close_box ->
>            mk_constr "Close_box" []
>          | Close_tag ->
> @@ -2950,6 +2943,19 @@
>            mk_constr "Alpha" [ mk_fmt rest ]
>          | Theta rest ->
>            mk_constr "Theta" [ mk_fmt rest ]
> +        | Formatting_lit (Open_box (org, _bty, _idt), rest) ->
> +          mk_constr "Formatting_gen" [
> +            mk_constr "Open_box" [
> +              mk_constr "Format" [
> +                mk_constr "String_literal" [
> +                  mk_string "<>";
> +                  mk_constr "End_of_format" [];
> +                ];
> +                mk_string "@[<>";
> +              ]
> +            ];
> +            mk_fmt rest;
> +          ]
>          | Formatting_lit (fmting, rest) ->
>            mk_constr "Formatting_lit" [ mk_formatting_lit fmting; mk_fmt rest ]
>          | Formatting_gen (fmting, rest) ->

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14984 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-14 21:08:50 +00:00
Gabriel Scherer 7cb9d0d84e PR#6418: fix format regression on "@{<..%d..%s..>" (Benoît Vaugon)
To be able to compile this patch, you should temporarily apply the
following patch to bootstrap the format type change:

> diff -Naur old/typing/typecore.ml new/typing/typecore.ml
> --- old/typing/typecore.ml	2014-06-06 03:37:03.240926150 +0200
> +++ new/typing/typecore.ml	2014-06-06 03:37:24.696926699 +0200
> @@ -2956,7 +2956,7 @@
>          | Theta rest ->
>            mk_constr "Theta" [ mk_fmt rest ]
>          | Formatting (fmting, rest) ->
> -          mk_constr "Formatting" [ mk_formatting fmting; mk_fmt rest ]
> +          mk_constr "Formatting_lit" [ mk_formatting fmting; mk_fmt rest ]
>          | Reader rest ->
>            mk_constr "Reader" [ mk_fmt rest ]
>          | Scan_char_set (width_opt, char_set, rest) ->

Bootstrap process:

  make core
  apply the patch above
  make core
  make promote-cross
  make partialclean
  revert the patch above, apply the commit
  make partialclean
  make core
  make coreboot

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14973 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 13:53:47 +00:00
Gabriel Scherer bb313fa192 Fix PR#6417: sprintf broken when local module named Pervasives is in scope
(Backport from Jacques' commit 4.02@14921)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 13:53:45 +00:00
Gabriel Scherer e0b000527b format+gadts: make format types "relational" to fix %(...%) typing
See the long comment in pervasives.ml for an explanation of the
change. The short summary is that we need to prove more elaborate
properties between the format types involved in the typing of %(...%),
and that proving things by writing GADT functions in OCaml reveals
that Coq's Ltac is a miracle of usability.

Proofs on OCaml GADTs are runtime functions that do have a runtime
semantics: it is legitimate to hope that those proof computations are
as simple as possible, but the current implementation was optimized
for feasability, not simplicity. François Bobot has some interesting
suggestions to simplify the reasoning part (with more equality
reasoning where I used transitivity and symmetry of the
relation profusely), which may make the code simpler in the future
(and possibly more efficient: the hope is that only %(...%) users will
pay a proof-related cost).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-21 13:23:13 +00:00
Gabriel Scherer 74b20bef58 replay trunk@14523: warn on non-principal format6 coercions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:17 +00:00
Gabriel Scherer 3ffa399b37 Use a nominal datatype for CamlinternalFormat.format6
This should make the type-checking of formats simpler and more robust:
instead of trying to find a pair as previously, we can now use the
path of the format6 type directly.

A nice side-effect of the change is that the internal definition of
formats (as a pair) is not printed in error messages anymore.
Because format6 is in fact defined in the CamlinternalFormatBasics
submodule of Pervasives, and has an alias at the toplevel of
Pervasives, error messages still expand the definition:

> Error: This expression has type
>          ('a, 'b, 'c, 'd, 'd, 'a) format6 =
>            ('a, 'b, 'c, 'd, 'd, 'a) CamlinternalFormatBasics.format6
>        but an expression was expected of type ...

Passing the option `-short-paths` does avoid this expansion and
returns exactly the same error message as 4.01:

> Error: This expression has type ('a, 'b, 'c, 'd, 'd, 'a) format6
>        but an expression was expected of type ...

(To get this error message without -short-paths, one would need to
define format6 directly in Pervasives; but this type is mutually
recursive with several GADT types that we don't want to add in the
Pervasives namespace unqualified. This is why I'll keep the alias
for now.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14868 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:13 +00:00
Jacques Garrigue 14c7fc4a0c apply patch for PR#6420: Bad error message for non-exhaustive matching on extensible types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14859 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 04:05:21 +00:00
Gabriel Scherer 4907bcf803 typecore.ml: fix format's expected-type mistake
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14826 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:07 +00:00
Gabriel Scherer ee90232220 add typer support for the new formats
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14822 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:59 +00:00
Gabriel Scherer be3eca64ed update Benoît's patch wrt. Parsetree changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14808 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:33 +00:00
Gabriel Scherer 736876eaea convert Benoît's first patch to bytes/string
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14807 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:31 +00:00
Gabriel Scherer 43647ba502 first part of Benoît Vaugon's format-gadts patch
After applying this patch, you should run:

  make library-cross
  make promote-cross
  make partialclean
  make ocamlc ocamllex ocamltools

and then immediately apply the following patches until the "second
part of Benoît Vaugon's format+gadts patch"; the bootstrap cycle is
not finished yet.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14806 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:29 +00:00
Jacques Garrigue c36565a6c6 avoid warning just before an error happens using -no-alias-deps
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14797 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:42:15 +00:00
Jacques Garrigue 77cf8b999e * split Typetexp.lookup_module and Typetexp.find_module
* fix semantics of -open by using Typemod.type_open_


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14795 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:02:26 +00:00
Jacques Garrigue 48ecf7eb15 Fix PR#6410: Error message for an attempt to use a functor as a module is confusing
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 08:13:04 +00:00
Jacques Garrigue d2194b72fe comment out Ctype.local_non_recursive_abbrev
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 07:48:55 +00:00
Jacques Garrigue eb2b1f64b1 indentation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14775 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:40:19 +00:00
Jacques Garrigue 7869662411 disable Clflags.transparent_modules when narrowing unbound identifier error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14774 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:35:54 +00:00
Jacques Garrigue b6500cc2a4 Fix PR#6405: unsound interaction of -rectypes and GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14769 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 05:46:07 +00:00
Alain Frisch bfccd68ecc Protocol to allow ppx processors to report warnings to the compiler (reported as warning 22).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:52:19 +00:00
Alain Frisch f0ef09de26 Expose a Typemod.type_interface (currently an alias of Typemod.transl_signature) by symmetry with type_implementation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14759 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 12:46:00 +00:00
Alain Frisch 36b25ec2f6 Minor tweak to raw dump of parsetree/typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 11:14:57 +00:00
Jacques Garrigue 88e8bec163 Fix PR#6394: Assertion failed in Typecore.expand_path
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 10:55:05 +00:00
Alain Frisch 9961e6a1c2 #6399: protocol (based on a built-in ocaml.error extension node) to let ppx tools send located errors to be reported by the compiler (patch by Peter Zotov).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 08:26:17 +00:00
Jacques Garrigue 1ce29d9bfc re-commit Leo's weak-dependencies pull request
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Alain Frisch 7e2333051a ocaml.warnerror built-in attribute.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14753 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:17:09 +00:00
Alain Frisch 0736512709 Revise behavior of ocaml.warning attribute: when used as a floating attribute (in a signature or structure), the scope is restricted to the current signature/structure instead of being global. Also support the new floating attributes in classes, with the same behavior.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14752 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:07:44 +00:00
Alain Frisch 110e97d400 When the payload of the ocaml.deprecated attribute is a string, report it as part of the warning message.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14751 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:39:51 +00:00
Alain Frisch 85a176334e Recognize both prefixed and unprefixed built-in attributes (e.g. ocaml.deprecated or deprecated).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:32:32 +00:00
Alain Frisch 27e9e78637 Accept a fully empty pattern matching. This can be generated by Camlp4 using its revised syntax, and this seems to be used in the wild.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14749 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 17:19:49 +00:00
Alain Frisch fa3224ec87 Indent + comment.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14744 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:54:34 +00:00
Alain Frisch 0f1fb19cbe #6318: Extend match...with with exception cases. (Patch by Jeremy Yallop, backend part by A. Frisch).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:49:37 +00:00
Alain Frisch 0b3423ef2c #6387: also allow attributes on methods in object types (< m [@foo] : int; ..>).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:21:45 +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
Alain Frisch 0f1bb864df Add support for floating attributes in class structures and class signatures. (Patch by Leo White.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 20:42:34 +00:00
Jacques Garrigue b78b19975a * Do not require cmi file to be present if module alias is not accessed
(using -trans-mod)
* Add warning 49 for that case; use same warning in place of deprecated
  for Env.scrape_alias


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14724 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 07:07:09 +00:00
Jacques Garrigue 95104b3924 revert commit 14719
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 06:19:55 +00:00
Mark Shinwell 521ac0213a weak dependencies with -trans-mod (github/ocamllabs/weak-depends 45e980a,21856a7,merge)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 12:50:20 +00:00
Alain Frisch b791d666d8 #6387: allow attributes on variants in polymorphic variant types.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14712 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:19:55 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Jacques Garrigue 48f52f450c merge Leo's patch for PR#6384
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14702 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 02:25:04 +00:00
Jacques Garrigue 6cb386e91c Fix PR#6383: Exception Not_found when using object type in absent module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14701 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-28 13:29:51 +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
Jacques Garrigue 979fe8b8ad Do not add absolute paths for information added to
the local environment in Env.components_of_module_make.
Fixes the bug reported by Mark Shinwell on caml-devel,
on 2014-04-23. This bug was related to module aliases.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 09:09:08 +00:00
Alain Frisch 9e23ded0d1 Check unicity of types introduced through exceptions. Do not discard exceptions from signatures if they introduce a type.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 16:09:31 +00:00
Alain Frisch dfce13de92 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:40:51 +00:00
Alain Frisch db015c2670 More precise location on 'name must be unique' error (report the identifier name instead of the whole declaration).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14660 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:34:52 +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 af3d4aa91f Better locations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14658 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:36:29 +00:00
Alain Frisch eb617b5fe7 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:33:41 +00:00
Alain Frisch 307caebc7a Proper renaming of the ident in Cstr_record during signature substitution.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14656 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:14:38 +00:00
Alain Frisch 942046117f Consider that exceptions with a record argument create an implicit type.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14655 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 12:35:02 +00:00
Jacques Garrigue 82e2f35a14 Fix PR#6376
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-21 10:38:04 +00:00
Alain Frisch c92bbee07d The type parameters of inlined record types are free variables that appear in the record definition (in order of syntactic appearance), both for GAT and non-GADT constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14640 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 13:20:47 +00:00