Please sign in to comment.
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
- Loading branch information...
Showing with 53 additions and 46 deletions.
- BIN boot/ocamlc
- BIN boot/ocamldep
- BIN boot/ocamllex
- +10 −6 otherlibs/threads/pervasives.ml
- +7 −6 stdlib/camlinternalFormat.ml
- +5 −5 stdlib/format.ml
- +12 −7 stdlib/pervasives.ml
- +2 −1 stdlib/pervasives.mli
- +5 −4 stdlib/printf.ml
- +3 −2 stdlib/scanf.ml
- +1 −1 testsuite/tests/typing-warnings/coercions.ml.principal.reference
- +1 −1 testsuite/tests/typing-warnings/coercions.ml.reference
- +7 −13 typing/typecore.ml