Commit Graph

740 Commits (8e928caea7c47e6ba8508cf2caaaa1ba9f8dca85)

Author SHA1 Message Date
octachron 1ecf7ea486 change unexpected existentials error message 2018-04-25 17:57:14 +02:00
Thomas Refis ac1ced70c5 Env.{make_copy_of_types,do_copy_types}: add some abstraction and explicit some invariants
Also, write a faster version: [do_copy_types (make_copy_of_types l env) env]
should have the same performance as the original [copy_types l env].
2018-04-25 10:08:05 +01:00
Thomas Refis ff091c2a7e do gadt things when there really are gadts 2018-04-25 10:08:04 +01:00
Thomas Refis c03581c932 use a record instead of tuples to represent partially typed cases 2018-04-25 10:08:04 +01:00
Thomas Refis 90e01856f3 duplicate type once, update in every branch containing a GADT 2018-04-25 10:08:04 +01:00
Thomas Refis 945066bd7b split copy_types in two 2018-04-25 10:08:04 +01:00
Thomas Refis 075b596817 delay adding pattern variables in the environment 2018-04-25 10:08:04 +01:00
Thomas Refis e22d9fce6b simplify add_pattern_variables: it just adds the given pattern variables to the
environment, and doesn't go and fetch anything from any random list ref.
2018-04-25 10:08:04 +01:00
Thomas Refis 4851e32d75 noop 2018-04-25 10:08:04 +01:00
Jeremy Yallop 78d00e83cb Fix Mantis PR#7767: interaction between labels and let rec check 2018-04-10 21:49:01 +01:00
Hugo Heuzard 002815c4bb allow to attach @@ attributes on exceptions 2018-04-09 22:29:46 +01:00
Gabriel Scherer 1115d6af82 tentative fix for letrec check error (MPR#7706)
The typechecker-level check for recursive value depends on whether
recursive values use a memory size that is statically known or depends
on their dynamic evaluation. An error in this check results in
a potential segfault.

The error is that the check currently considers all
variables/identifiers to have a statically-known size. This is
certainly wrong for locally-defined identifiers, that may be bound to
dynamically-sized expressions. We rule this case out by carrying an
environment during size-checking, that remembers the size
(static or dynamic) of local bindings.

The implementation is incomplete in certain ways, but safely defaults
to Dynamic as the size of bindings that it does not track through the
environment.
2018-04-09 16:51:47 +02:00
Gabriel Scherer 9eea16952f Typecore.classify_expression: minor reordering and indentation changes 2018-04-09 16:51:47 +02:00
Damien Doligez 90fbe53ee5 Revert "Merge pull request #1472 from Armael/improved-error-letrec"
This reverts commit c224184471, reversing
changes made to 2fc77a2d58.

As an exception, commit 3b77d915b5 (Generalize Env.lookup_* functions to allow disabling marking) is NOT reverted, because it was used by subsequent commits.
2018-04-09 15:56:00 +02:00
Jacques Garrigue 3d33bd4ef5
Fix MPR#7751 (#1657)
Fix the toplevel printer, to have it properly load needed cmi's.
2018-03-27 09:25:28 +09:00
Thomas Refis 79d3f77433 typecore: remove trivially dead code 2018-03-21 15:07:46 +00:00
Thomas Refis b7101be913 do not spuriously warn 2018-03-15 13:05:26 +00:00
Leo White bce9d4b659 Fix usage warnings with no mli file (#1358) 2018-03-14 17:57:31 +01:00
Thomas Refis 15e8f62b85 straightforward GADT disambiguation
Also: bootstrap + Changes
2018-03-12 14:55:42 +00:00
Leo White 3340fb5ba6 Reraise and raise_notrace are also nonexpansive 2018-03-06 12:27:53 -05:00
objmagic 0993cd9ba9 Support empty variants (#1546)
* Allow empty variants.
* Update manual and ocamldoc.
2018-03-06 10:48:16 +09:00
Thomas Refis acf4d56e76 check that no ambiguous pattern type escapes its scope earlier on.
This gives more stable error messages.
2018-02-27 14:52:25 +00:00
Thomas Refis f509125318 slight representation change 2018-02-27 14:52:24 +00:00
Thomas Refis d43ccfc5d4 type_cases: decrease the sharing between the type of the scrutiny and that of each pattern
See discussion on MPR#7618 .
We also add a late check of ambiguous type escape.
2018-02-27 14:52:24 +00:00
Thomas Refis 7f0e819bde we don't need an env to take instances anymore 2018-02-27 14:52:24 +00:00
Thomas Refis f3a41038be use scope instead of gadt_instances 2018-02-27 14:52:24 +00:00
Thomas Refis 39b864f160 revert 88e8bec and 7b1140f : there should be no incoherent manifests anymore 2018-02-08 10:23:04 +00:00
Jeremy Yallop 72409876fc Fix PR7717 (Don't treat unboxed constructors as statically sized) 2018-02-01 21:58:56 +01:00
Thomas Refis 1b670fb2f1 type_cases: use a more precise ty_arg for parmatch checks 2018-01-31 11:26:30 +00:00
Thomas Refis f00544f5ea type_cases: also take an instance of ty_arg when checking exhaustiveness 2018-01-31 11:26:29 +00:00
Thomas Refis 8cf1cc4e7d type_cases: be more regular 2018-01-31 11:26:29 +00:00
Jacques Garrigue 55e6d747fd
Follow up to #1559 : have the name of unknown missing tag depend on the row (#1564)
Print `AnyOtherTag (with possible extra apostrophes to avoid conflicts) it there is a row variable,
or `<some private tag> if this is a private row.
2018-01-18 13:01:31 +09:00
Jacques Garrigue f1a52b4556 change name to <some other tag> 2018-01-09 12:51:37 +09:00
Jacques Garrigue 582b7f803c add comment in code 2018-01-08 18:30:19 +09:00
Jacques Garrigue f7fabd7b7e add GPR number and check argument is None 2018-01-05 14:50:50 +09:00
Jacques Garrigue 1b5c76fabf Fix MPR#7704 2018-01-05 14:39:50 +09:00
Jacques Garrigue 839fe875f1 Fix MPR#7695 (#1541)
Some typing errors were not properly caught and reported, causing a compiler error
("Fatal error: exception Ctype.Unify(_)").

Test added.
2017-12-28 19:36:56 +01:00
Armaël Guéneau ea00ce020f Add specific error messages in case of type propagated from a keyword 2017-12-21 11:50:54 +01:00
Jeremy Yallop 0ed73814a6 let rec: allow float array construction if configured with -no-flat-float-array 2017-12-06 15:19:01 +00:00
Thomas Refis b4323c907f parmatch: remove commented out code, rename *_gadt into * 2017-12-04 12:11:21 +00:00
Thomas Refis 60c5f6fe91 parmatch: split pretty printing out into Printpat 2017-12-04 12:11:21 +00:00
Armaël Guéneau 935cb11e6e Rephrase a suggestion in a typing error message related to coercions 2017-11-30 18:31:56 +01:00
Armaël Guéneau 9f75022603 Add specific error messages for missing 'rec' in let bindings
Original design and idea by Arthur Charguéraud
2017-11-17 18:42:16 +01:00
Armaël Guéneau 11eb5bbf16 Generalize add_pattern_variables to also return pattern variables 2017-11-13 20:48:44 +01:00
Armaël Guéneau 9704f790be Generalize Val_unbound with a reason 2017-11-11 15:43:31 +01:00
Alain Frisch 3d5e3a7640 Ensures CBV semantics when eta-expanding function to eliminates optional arguments (#1424)
Fix MPR7657: ensure CBV semantics when eta-expanding function to eliminate optional arguments.
2017-10-18 17:23:40 +02:00
Jeremy Yallop 776387b47c let-rec check: use Map, not Ident.tbl, for the "type" that tracks variable use.
The extra semantics of Ident aren't needed, and add significant extra cost.
2017-10-09 19:22:36 +02:00
Jacques Garrigue 70b02405e0 Merge pull request #1365 from yallop/let-rec-patch-406
GPR#556, PR#7215, PR#7231, PR#6738: Add a new check that 'let rec' bindings are well formed.
2017-09-22 15:37:10 +09:00
Leo White 2798245738 Merge pull request #1314 from xclerc/ocaml-bool-padding
Padding for boolean formatting
2017-09-14 13:26:00 +01:00
Xavier Clerc 94b7ab801e Tentative fix for MPR#7624 (#1327)
* Tentative fix for MPR#7624.

* Move the warning scope to the computation of pat_slot_list (because of delayed checks).

* Fix computation of `warn_unused` (using binding attributes) and add tests.

* Test enabling binding-level warning when they are globally disabled.

* Rename `warn_unused` to `warn_about_unused_bindings` for better readablity.
2017-09-13 23:50:42 +02:00
alainfrisch 1d6cbae277 Use let-binding attributes also for the pattern, and when checking exhaustivity. 2017-09-12 00:36:46 +02:00
alainfrisch fe08260c24 Support ocaml.attribute in type and pattern expressions. 2017-09-12 00:35:18 +02:00
alainfrisch e06e0f2fe9 Cleanup processing of warning/warnerror attributes. 2017-09-12 00:35:18 +02:00
Jacques Garrigue 59bf0620e3 GPR#1318: must unify cases 2017-09-07 16:13:34 +01:00
Jacques Garrigue 4826548d43 Changes and clean-up 2017-09-06 09:18:24 +01:00
Jacques Garrigue c854a9b92e Fix MPR#7617 and #7618 2017-09-06 09:15:38 +01:00
Xavier Clerc 1b7abeddf1 Formats: use the optional width when formatting a boolean. 2017-09-01 13:22:00 +01:00
Jacques Garrigue 2165cca89f remove changes in ctype.ml and replace by a comment 2017-08-29 09:04:47 +09:00
Jacques Garrigue 83d4b6ccba spurious semicolon 2017-08-03 10:12:01 +09:00
Jacques Garrigue 9aea65451d Fix PR#7519, but high cost in update_level 2017-08-02 14:25:58 +09:00
Alain Frisch fd47ba9649 Support 'let open' in class and class type expressions (#1249)
* Support 'let open' in class and class type expressions.

* Adapt ocamlprof.

* Adapt ocamldoc.

* Add tests.

* Changelog.

* Manual.
2017-07-20 08:17:30 +02:00
Stephen Dolan a4ea78bd19 Make (raise e) nonexpansive.
Test in typing-poly/poly.ml.
2017-05-12 14:09:06 +01:00
Stephen Dolan 93fdf397dc Make assertions nonexpansive.
This allows the type of 'assert false' to generalise.
2017-04-07 16:12:39 +01:00
alainfrisch d8b413f17f Expose a more explicit 'copy types' operation in Env (with a representation in summary), instead of a more generic 'update_value'. 2017-03-24 14:24:36 +01:00
octachron dc51e513e3 MPR#7443: pattern open, false unused open warning 2016-12-28 22:15:07 +01:00
Jacques Garrigue 09fcd51004 Fix P#7395 by reverting 9a2015 2016-12-14 13:14:21 +00:00
Jacques Garrigue 8c4ec6aed3 Fix PR#7391 by only initializing for GADTs when checking exhaustiveness 2016-12-14 13:14:21 +00:00
Jacques Garrigue dab6c2b4d2 also allow Ppat_constraint in PR#7391 2016-12-14 13:14:21 +00:00
Jacques Garrigue 84681d3cda Fix PR#7391 2016-12-14 13:14:21 +00:00
Jacques Garrigue e97886b85c revert spurious line break 2016-12-14 13:14:21 +00:00
Jacques Garrigue e0bd0c3dcd Fix PR#7298 2016-12-14 13:14:21 +00:00
Jacques Garrigue c06cdbea0a Fix PR#7390 2016-12-14 13:14:21 +00:00
Jacques Garrigue c1a7ace277 PR#6608: remove extended_expression field if all fields are explicitly given 2016-12-14 13:14:21 +00:00
Jacques Garrigue a4e0db3efe Fix PR#7381 2016-12-14 13:14:21 +00:00
Damien Doligez 10e5659edb fix discrepancy between the executables generated by
ocamlc.opt and ocamlc.byte (and between ocamlopt.opt and ocamlopt.byte)
(reported by Sebastien Hinderer)
2016-12-14 13:14:21 +00:00
Jacques Garrigue c5a1da3103 Fix PR#7297 2016-12-14 13:14:21 +00:00
Jacques Garrigue d8429e5caa Fix PR#7421 2016-12-08 16:28:24 +09:00
Tadeu Zagallo 844016f58b PR#6608: Unify record types when overriding all fields 2016-11-10 16:40:06 +00:00
Mark Shinwell 2da2fcdb66 Annotate Texp_function with an Ident.t for the parameter (#831) 2016-10-14 09:34:50 +01:00
Jacques Garrigue 49504101ee Fix PR#7330
(Cherry-picked from trunk, b4b21d6af0032de5ac973ecc4fedeb6763eccf9c.)
2016-10-07 10:22:35 +02:00
Fabrice Le Fessant a424f0aae1 Add missing locations in the parsetree (#749)
They are not propagated to the typedtree yet.
2016-08-29 16:21:38 +02:00
Gabriel Scherer 4aef4cea63 PR#7315: refine some error locations (#736) 2016-08-04 10:50:27 +02:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Damien Doligez d5a6e50ebe GPR#606: add unboxed types 2016-07-21 13:51:46 +02:00
Pierre Chambart 24f947e95d Change Texp_record into an inline record 2016-07-11 16:51:20 +02:00
Pierre Chambart c2e66f0097 Switch declaration and definition order in Tepx_record fields 2016-07-11 16:51:20 +02:00
Pierre Chambart 6f010f987c Merge record label descriptions and definition into a single array 2016-07-11 16:51:20 +02:00
Pierre Chambart 338da55d31 Clean translcore record case using the change in Texp_record 2016-07-11 16:50:36 +02:00
Pierre Chambart 0cf5f5409f Emit type error as soon as we know that a label is missing 2016-07-11 16:50:36 +02:00
Pierre Chambart 415f5d804e Factorisation in the Pexp_record case of Typecore 2016-07-11 16:50:36 +02:00
Pierre Chambart 3f00684169 Change Texp_record contents to ease the use
It also allows to recover the type of kept fields in a
{ record with field = expr } expression
2016-07-11 16:50:36 +02:00
Jacques Garrigue 9d77b268ed Fix PR#7285 2016-07-07 18:10:37 +09:00
Alain Frisch cba6c6b208 Merge pull request #601 from nojebar/better-locs-for-default-args
Better ghost locs for default parameters.
2016-06-14 14:05:13 +02:00
Jacques Garrigue 4feaea361e Merge pull request #579 from garrigue/nested_equations
MPR#7233: Support GADT equations for non-local abstract types
2016-06-13 10:15:35 +09:00
Jacques Garrigue 3cb6d6c702 PR#7233: GADT equations for non-local abstract types 2016-06-13 09:25:31 +09:00
Jacques Garrigue 240fde10ac Fix PR#7269 again, cancelling previous fix 2016-06-03 16:50:28 +09:00
Nicolas Ojeda Bar 0c15e25394 Better ghost locs for default parameters.
When translating a parse tree to the corresponding typed tree
a function definition

  fun ?(arg = foo) -> e

is translated to (using ocaml syntax):

  fun *opt* ->
    let arg =
      match *opt* with
      | Some sth -> sth
      | None -> foo
    in
    e

Currently the match term is given the location of the whole function term
(including e), which is incorrect and trips cmt-based tools that work based on
location.

This patch gives a location to the match construct corresponding to
the fragment 'arg = foo' in the original program.
2016-06-02 12:37:11 +02:00
Jacques Garrigue a4e355a757 Fixed PR#7260 2016-06-02 17:25:10 +09:00
Jacques Garrigue deb1535f42 separate local constraints from types in Env.t, and use it for local open in patterns 2016-05-09 09:38:07 -04:00
octachron 96806cf633 GPR#187: local open for patterns
This commits extends the pattern syntax to support local open in
patterns. Four new constructions mirroring the expression constructions
are added

    * `M.(pattern)`
    * `M.[pattern_list]` ⟺ M.([pattern_list])
    * `M.{labeled_pattern_list}` ⟺ M.({label_pattern_list})
    * `M.[| .. |] ⟺ M.( [| .. |] )

At the typing phase, the construction `M.(pattern)` brings all
identifiers defined within M inside the scope and then proceed with the
typing of `pattern`. All others constructions are desugared to the
`M.(..)` construction during parsing.

Questionable implementation details:
* Currently, the local pattern open use the `type_open` function like
the local expression pattern. However, this implies that values defined
inside `M` are also brought to the scope. A specialized
`type_open_for_pattern` would be more efficient.
2016-05-09 09:35:05 -04:00
Damien Doligez 520fb2df50 Merge tag 4.03.0 into trunk. 2016-04-28 16:13:21 +02:00
Jacques Garrigue 8667b66853 Fix PR#7214 2016-04-08 16:00:04 +09:00
alainfrisch 166ba71479 Merge branch '4.03' into trunk 2016-03-21 23:29:54 +01:00
alainfrisch 5edc0e38bd MPR#7190: improve error message for inline records. 2016-03-21 22:41:25 +01:00
alainfrisch 0095905158 Merge branch '4.03' into trunk 2016-03-16 21:38:10 +01:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
alainfrisch 43f90e9f58 Local let exceptions. 2016-03-15 22:02:55 +01:00
alainfrisch ddb2826029 Fix #6677: allow to disable warning 39 through an [@ocaml.warning] attribute on the first value binding. 2016-03-14 17:16:48 +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
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Jacques Garrigue b12e708ef4 Fix PR#7135: only warn about ground coercions in -principal mode 2016-02-05 10:54:24 +09:00
Will Crichton 50dd38d4b6 Add support for immediate attribute 2016-02-02 11:45:07 +00:00
Jeremie Dimino 43111b38cd Replace uses of [Syntaxerr.ill_formed_ast] by asserts
All invariants are already checked by [Ast_invariants]
2016-01-27 18:41:12 +00:00
Thomas Refis d9337d856d Better type error location in presence of constraints 2016-01-26 10:48:34 +00:00
Drup 6095df954e Rename parsetree constants.
PConst -> Pconst
int -> integer
2016-01-18 00:12:38 +01:00
alainfrisch 4e8cb78bf5 Fix #7115: shadowing in a branch of a GADT match breaks unused variable warning. 2016-01-05 11:19:10 +01:00
Luc Maranget 1fe21ec4c3 Fix minor bug, avoid douple unpacking in the case of
(module M:S) | (module M:S) -> ... M ..
That is or pattern whose arguments contain module variables
(AST: Ppat_unpack).
2015-12-14 15:58:12 +01:00
Luc Maranget 6a89000b5c PR#7031 ambiguous guarded or-pattern.
- Check proper (in parmatch.ml)
  - Call check just after unused pattern check (in typecore.ml, correct ?)
  - Define and print warning (in warning.ml)
2015-12-14 15:58:02 +01:00
Gabriel Scherer d071da2880 Revert GPR#305 (exception patterns under or-patterns) from trunk
This week we merged several changes from Thomas Refis, to allow the
use of exception patterns under or-patterns, to write code such as

  match foo x with
    | None | exception Not_found -> ...
    | Some -> ...

Unfortunately, I failed to properly assess the impact of this change,
and in particular to make sure that Luc Maranget had properly reviewed
this code -- any change to the pattern-matching machinery should be
reviewed by Luc.

The problem that I had not foreseen and that he would have immediately
realized is that, while adapting the pattern-matching *compiler* is
relatively easy (Thomas inserted a transformation at the right place
to separate exception patterns from the others and handle them
separately, using the staticraise construct used by the
pattern-matching compiler to avoid duplicating the
right-hand-side branch), adapting the pattern-matching warnings
machinery is both more subtle and easier to overlook (it may fail
silently and nobody notices, unlike wrong code production). This part
of the compiler is subtle and best understood by Luc, but he does not
have the time to do a proper review of those changes in the timeframe
for the 4.03 feature freeze (mid-December).

I believe the right move in this case, implemented in the present
commit, is to revert the change from trunk (this is not a feature that
we must *imperatively* have in 4.03), do a proper job of understanding
the changes, and integrate the change when we are confident it is
ready. I hope to do this in 2016, together with Luc Maranget and
Thomas Refis -- hopefully this would allow Thomas and I to be more
confident when changing the pattern-matching machinery in the future.

Revert "Merge pull request #343 from trefis/pr7083"
This reverts commit 22681b8d2a, reversing
changes made to a24e4edf0a.

Revert "Merge pull request #341 from trefis/or-exception"
This reverts commit f8f68bd329, reversing
changes made to 1534fe8082.

Revert "Merge pull request #305 from trefis/or-exception"
This reverts commit cfeda89396, reversing
changes made to 77cf36cf82.
2015-12-12 11:20:21 +01:00
Jacques Garrigue e0aec3391c Fix PR#7085 2015-12-12 18:06:47 +09:00
Thomas Refis 4b28c6ca99 PR#6422: Allow exceptions under or-patterns in match statements. 2015-12-09 11:19:59 +00:00
Jacques Garrigue 8db1b59233 PR#6542: choeger's patch for type_cases (only generalize when useful) 2015-12-08 19:47:08 +09:00
Jacques Garrigue 78a7a55609 PR#6542: solve new performance problems du to path compression and copy
of types for the delayed icheck for unused cases
2015-12-08 19:45:42 +09:00
Hugo Heuzard 9eca3e4519 Parse arbitrary precision integers ..
.. and allow any letter in [g-zG-Z] as modifier (previously 'l','L','n')
Also allow modifier for floats
This give more freedom to ppx rewritters (what about a ppx for zarith)

Checks are performed when translating from Parsetree to Typedtree.
Invalid_literal is raised if the modifier is not recognized ([lLn]?)
Integer_overflow is raised as before.

Lexer: use g-zG-Z for integer literal modifier

Lexer: Allow modifier on float

Clean wrt previous commits

Lexer: use named substring

Cleanup

typo

doc

fix after rebase

rebase on  trunk

Update typecore.ml

Fix printast.ml
2015-12-03 17:20:48 +01:00
alainfrisch 6b9d72d532 A new builtin attribute ocaml.deprecated_mutable; can be applied to a record label so as to trigger a Deprecated warning if the field is mutated. 2015-12-02 18:20:24 +01:00
alainfrisch c9a44eef22 Move detection of more builtin attributes to new module. 2015-12-02 15:52:04 +01:00
alainfrisch 7ad212045f Add module to deal with 'front-end' built-in attributes. 2015-12-02 14:46:14 +01:00
Jacques Garrigue a1bb57048c Fix PR#6946 2015-11-30 16:45:44 +09:00
Jeremie Dimino ebd830b85b Add support for [%ocaml.extension_constructor <path>]
Translate [%ocaml.extension_constructor <path>] to the
runtime-representation of the extension constructor denoted by
<path>. This allows one to get the extension constructor without
having to create a dummy value.
2015-11-27 18:17:14 +00:00
Nicolas Ojeda Bar a524920aa2 Remove Typedtree.optional
From comments in typedtree.mli:

When introduced in 2000, this [type] enabled a more efficient code
generation for optional arguments. However, today the information is
redundant as labels are passed to [transl_apply] too. Could be cleaned
up.
2015-11-25 00:37:46 +01:00
alainfrisch fe68945a20 Only the return idents are useful in pat_bound_idents, simplify accordingly. 2015-11-24 15:43:26 +01:00
Xavier Leroy 0c5e862a3e GPR#268: Hexadecimal notation for floating-point numbers
Merge of branch 'hex-float'.

- Add support in byterun/floats.c for conversions between floats and strings in hex notation. We cannot rely on the C standard library here because Microsoft consistently fails at supporting hex notation as standardized in C99. Instead, the conversions are implemented from scratch.
- Add support in the lexer so that hex float literals are recognized in OCaml sources.
- Add support in formats. The ISO C99 format letters for hex floats are %a and %A, but %a is already taken. I chose %h and %H, which are rejected today as bad formats (hence no backward incompatibility) and don't mean anything in C either (h is a modifier, not a format letter).
- Add support in printf. All the trimmings are there in the implementation of %h and %H, including sign modifier and fixed precision.
- Benoit Vaugon contributed support in scanf.

Resolved conflicts:
	boot/ocamlc
	boot/ocamldep
	boot/ocamllex
	parsing/lexer.mll
2015-11-19 10:37:20 +01:00
Mark Shinwell 8f7f3162a7 Fix text of message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16535 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 14:36:56 +00:00
Jacques Garrigue a335b18a45 merge branches/gadt-warnings
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16532 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 08:33:44 +00:00
Alain Frisch 3856cd00c5 Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 14:55:15 +00:00
Jacques Garrigue e34f40ad87 switch to 'pat -> .' and add P/Texp_unreachable
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 00:13:40 +00:00
Jacques Garrigue 4188f0543d mark empty matches as Partial
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:59:28 +00:00
Jacques Garrigue b784b65925 add distinct warning for unreachable cases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16504 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:39:59 +00:00
Alain Frisch a21eaeaa40 GPR#254: @ocaml.arg_on_literal_pattern attribute on constructors
to warn when the argument is matches against a constant pattern.
This attributes is applied on predefined exception constructors
which take an purely informational (with no stability guarantee)
message.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 12:30:10 +00:00
Jacques Garrigue a09fb037ac add refuted cases, syntax is 'pat -> _'
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 01:55:52 +00:00
Jacques Garrigue e6075fd1e3 recursive expansion for single cases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-13 12:38:07 +00:00
Jacques Garrigue bcddc5aa37 make exploding depth explicit
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16495 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-13 09:53:27 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Jacques Garrigue 3b0837181f make all
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16404 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 18:49:52 +00:00
Jacques Garrigue 254ab1d1b6 check for unused cases due to GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16400 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 08:53:47 +00:00
Xavier Leroy bb86f5b545 Preliminary support for hexadecimal notation for FP numbers.
- Primitives:
     caml_float_of_string  extended to recognize "0x" hexa notation
     caml_hexstring_of_float  new primitive
  We do not assume hex floats are supported by the C standard library.
  Instead, conversions hex string <-> float are implemented manually.
- Printf: hex FP output supported with formats %h / %H
- Scanf: remains to be updated (see TODO in stdlib/scanf.ml)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/hex-float@16257 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 09:29:33 +00:00
Damien Doligez 3e17d04ef0 PR#6931: Incorrect error message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16235 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-22 14:04:39 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Gabriel Scherer e9785253b2 PR#6876: improve warning 6 by listing the omitted labels.
(Eyyüb Sari)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-24 07:33:32 +00:00
Jacques Garrigue f1bcf0eb6d use or-patterns in exhaustiveness warnings when possible
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16136 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-21 03:29:47 +00:00