Commit Graph

1675 Commits (97a89e2fd99c2a71979635d2f498c2cadc2d5f83)

Author SHA1 Message Date
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 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
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 ac62abe4d2 #6342: fix error message when constraints differ in type declarations. 2015-12-03 00:06:18 +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
alainfrisch 90544ab95e Merge with trunk. 2015-12-02 12:00:44 +01:00
alainfrisch 3f2ffb7197 Fix for the debugger. 2015-12-02 11:43:10 +01:00
alainfrisch 10fbfe7643 Pass location to Env.lookup_ functions explicitly. 2015-12-02 10:21:24 +01:00
alainfrisch 2740b1bf7c Show full path on deprecated warning. 2015-12-02 09:40:02 +01:00
alainfrisch 3842acd676 Avoid warning duplication: checking module deprecation is done in Env. 2015-12-01 18:01:59 +01:00
alainfrisch 56a094e8e6 Recognize ocaml.deprecated floating attribute on top of .ml files to support marking the unit as deprecated even if it has no .mli file. 2015-12-01 17:55:26 +01:00
alainfrisch ccff19a537 Also trigger warning when accessing a qualified sub-module marked as deprecated. 2015-12-01 17:39:10 +01:00
alainfrisch e9e3da700d Trigger deprecated attribute when referring to a deprecated module itself (not one of its components): now for external unit as long as we don't compile with -no-alias-deps. 2015-12-01 17:27:30 +01:00
alainfrisch c424dd963a Trigger deprecated attribute when referring to a deprecated module itself (not one of its components). Does not work for external unit yet. 2015-12-01 17:15:36 +01:00
alainfrisch 114e733864 Store deprecated flag in 'module components' and raise the deprecated warning when accessing a component from a deprecated module if is has been marked, even for non-toplevel modules. 2015-12-01 17:11:27 +01:00
alainfrisch 6018c023aa Turn Env.components into a record, which will be later extended. 2015-12-01 16:42:37 +01:00
alainfrisch 11ea50d8e2 PR#6762: improve warning 45 (shadowing caused by open) for labels/constructors in presence of re-exported type definitions. 2015-12-01 09:30:41 +01:00
Jacques Garrigue f7d20f161a Fix for commit 9229b1 2015-12-01 01:53:24 +09:00
Jacques Garrigue a1bb57048c Fix PR#6946 2015-11-30 16:45:44 +09:00
Jacques Garrigue 20b59a3318 Fix PR#6981 2015-11-30 15:17:41 +09:00
Jacques Garrigue 9229b15aaa Fix PR#6980 and remove unused Ctype.iterative_generalization 2015-11-30 13:49:30 +09:00
alainfrisch c95f85a3f4 Interpret deprecation warning when looking up external units. 2015-11-27 19:31:58 +01: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
alainfrisch 945d0c7d7a Keep deprecation flag on compilation unit, extracted from a floating attribute in the .mli file. 2015-11-27 19:13:56 +01:00
Jeremie Dimino 09b8c4e031 Add the predefined type extension_constructor
So that we can create constants of type [extension_constructor]
2015-11-27 17:52:33 +00:00
Jacques Garrigue 61c2dd2220 Do not warn for unused [pat -> .] clauses 2015-11-26 15:01:58 +09:00
Jacques Garrigue 88ada8c74c be more careful about undoing compression 2015-11-26 14:16:07 +09:00
Jacques Garrigue 7e880f4e0a Merge branch 'trunk' of github.com:ocaml/ocaml into compress-Tlink 2015-11-26 14:04:35 +09:00
Thomas Refis 0b1a6f93a8 make Types.type_expr.id immutable
Cf. https://github.com/ocaml/ocaml/pull/310#discussion_r45822414
2015-11-25 17:32:56 +00:00
Frederic Bour 9107f14afc Comment [Types] 2015-11-25 17:32:55 +00:00