Commit Graph

1708 Commits (166ba7147983c961f5cb220fe3222b59d68c75e2)

Author SHA1 Message Date
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
Jacques Garrigue 2913cf11b0 Fix PR#7112 2016-03-16 18:23:46 +01:00
alainfrisch 502e4f9336 More warnings when compiling the compiler. 2016-03-15 22:46:35 +01:00
Alain Frisch f4a29c6ca2 Merge branch '4.03_merged_in_trunk' of https://github.com/bobot/ocaml into bobot-4.03_merged_in_trunk 2016-03-15 22:09:24 +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
alainfrisch 42a5b36bab Fix probable bug.
"Probable" because this was found by code inspection after enabling warning 27.  I assume
this could lead to an actual bug in the type-checker, but I have not tried to trigger it.

Fix confirmed by @garrigue.
2016-03-09 12:00:42 +01:00
Jacques Garrigue 05922fa6f9 Fix PR#7152: lower level of non-generalized variables to binding time of enclosing module 2016-03-06 23:17:45 +09:00
Jacques Garrigue 607b0f879e Fix PR#7152: lower level of non-generalized variables to binding time of enclosing module 2016-03-06 23:15:55 +09:00
Jacques Garrigue e21dd561b2 Fix PR#7160: Type synonym definitions can weaken gadt constructor types 2016-03-03 10:00:18 +09:00
Jacques Garrigue a18af2a837 Fix PR#7160: Type synonym definitions can weaken gadt constructor types 2016-03-03 09:58:26 +09:00
Jacques Garrigue df23448196 Fix PR#7113: -safe-string can break GADT compatibility check 2016-03-01 09:35:29 +09:00
Jacques Garrigue c989c820fb Fix PR#7113: -safe-string can break GADT compatibility check 2016-03-01 09:30:35 +09: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
Nicolas Ojeda Bar e343dd0ba6 Adapt emit_external_warnings and error_if_has_deep_native_repr_attributes 2016-01-27 23:05:28 +01: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
Damien Doligez 012cb8bd7b Merge pull request #335 from hhugo/missing_cmi
GPR#335: Typing: unification error - warn about missing cmi
2016-01-27 15:35:49 +01:00
Thomas Refis d9337d856d Better type error location in presence of constraints 2016-01-26 10:48:34 +00:00
Jérémie Dimino fe0968f080 Merge pull request #439 from mlasson/warnings_unboxed_untagged
More errors with unboxed and untagged attributes
2016-01-20 11:05:15 +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
alainfrisch 09bc267038 Simplify. 2016-01-19 23:42:54 +01:00
alainfrisch 87de6a160d Useless bindings, unit patterns, whitespace. 2016-01-19 23:40:55 +01:00
Drup 6095df954e Rename parsetree constants.
PConst -> Pconst
int -> integer
2016-01-18 00:12:38 +01:00
Nicolas Ojeda Bar c242a29b12 Compile with -principal 2016-01-14 15:29:41 +01:00
Pierre Chambart 38ce618089 Make the Ident module identifiable 2016-01-12 18:01:25 +01:00
Mark Shinwell 91b475ef9e Predef 2016-01-12 15:57:44 +01:00
Mark Shinwell a76810c7ee More things in Predef 2016-01-12 15:50:27 +01:00
alainfrisch b626516a32 Fix #7119 (@@@warning attribute not persistent from one toplevel phrase to the next one). 2016-01-08 09:23:24 +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
Leo White 9216c69017 Add warning for missing .cmx files 2015-12-26 08:29:47 +00:00
Hugo Heuzard 5cddcf7363 Typing: unification error - warn about missing cmi
update guard

misc
2015-12-22 10:30:05 +01:00
Hugo Heuzard 1720d9f42d fix pr7103
the following type error

"Type a is not compatible with type 'a"

should contain the constraint on 'a.

"Type a is not compatible with type 'a = < .. >"
"Type a is not compatible with type 'a = [> `b]"
2015-12-21 13:24:59 +00:00
maranget 57e031d86d PR#7031 Oups, bug in merged code: union changed into intersection. 2015-12-15 16:39:00 +01:00
Gabriel Scherer aa248d3c73 comment and refactor the code: now I understand it all! 2015-12-14 15:58:12 +01:00
Luc Maranget e2309b424a PR#7031 Handle module variables in patterns. 2015-12-14 15:58:12 +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
Gabriel Scherer f53c1e960c minor: add Path.heads: find all Ident.t free in a Path.t 2015-12-14 15:58:12 +01:00
Luc Maranget 74356166ac PR#7031 Fix ambiguous orpats + guards in the compiler. 2015-12-14 15:58:11 +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 2bdc8f610a minor: add Ident.compare to call Set.Make(Ident) directly 2015-12-14 15:20:10 +01:00
Jacques Garrigue 7bcfced414 Fix PR#7082 2015-12-14 12:49:51 +09: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 de7176b02f PR7083: fix assertion failure when polymorphic variants and exception cases are part of the same match .. with 2015-12-11 10:31:33 +00:00
Jeremie Dimino 87f92ab0fb PR#7081: report preprocessor warnings in the toplevel 2015-12-10 10:06:03 +00:00