Commit Graph

76 Commits (master)

Author SHA1 Message Date
Thomas Refis 4edc4b9928
pattern aliases do not ignore type constraints (#1655) 2020-07-09 12:20:37 +02:00
Leo White c19e8b2350 Refactor environment lookup functions 2019-08-15 15:56:50 +01:00
Matthew Ryan c33e46d69b Use newtype names as the underlying variable names (#2277)
* Use newtype names as the corresponding name when they are valid
2019-03-26 08:22:21 +09:00
Florian Angeletti 3de40984ba a type for unification traces 2018-10-17 17:27:16 +02:00
Jacques Garrigue 7aa377a630
New attempt at fixing MPR#7726 (#1676)
* Fix MPR#7726 by re-checking recursive modules in signatures after substitution
* Check module applications when translating types in Typetexp
* Check all results of functor applications lazily
* Reduce the overhead of checking module types by building the environment lazily
2018-07-13 05:29:59 +09:00
Armaël Guéneau 7f42ee9276 Allow spellchecking in case of missing rec hint 2018-05-06 10:08:09 +02:00
Valentin Gatien-Baron cf2dd9b01b report nice errors for applicative functors in all cases 2017-12-12 23:51:50 -05:00
Valentin Gatien-Baron f03aaad16f reject the use of generative functors as applicative (MPR#7611) 2017-12-12 23:51:50 -05:00
Valentin Gatien-Baron 2c67a57514 try to clarify what the subtyping error is about 2017-12-12 23:51:49 -05:00
Valentin Gatien-Baron a9aef5629b Improve error reporting for ill-typed applicative functor type, F(M).t 2017-12-12 23:51:19 -05:00
Runhang Li d459674326
Unify, rather than copy. 2017-03-26 23:37:13 -07:00
Mark Li 9dc86f8417
Support inherited field in object type expression.
Also add location on object field label and polymorphic variant tags.
2017-03-22 21:47:34 -07: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
alainfrisch 7ad212045f Add module to deal with 'front-end' built-in attributes. 2015-12-02 14:46:14 +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 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 945d0c7d7a Keep deprecation flag on compilation unit, extracted from a floating attribute in the .mli file. 2015-11-27 19:13:56 +01:00
Leo White 99ad68d256 Improve error for ill-typed functor application 2015-10-26 10:32:41 +00:00
Leo White 15cc266e2f Better -no-alias-deps errors 2015-10-22 17:11:08 +01: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
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
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
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 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
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
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
Jacques Garrigue 8fb5fdc9f2 merge trunk:14244 to fix bootstrap
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14245 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-24 04:19:08 +00:00
Jacques Garrigue c628fb2dc9 Do not add module aliases to imports
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14219 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-08 08:18:38 +00:00
Alain Frisch f1bc74bcc8 #5445: interpret warning attribute on expressions, and as floating signature/structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 08:18:50 +00:00
Alain Frisch cc31694f7c Keep attributes on module declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 17:05:39 +00:00
Alain Frisch c0778758c1 Keep attributes/locs for class type declarations and class declarations in Types. Renaming cty -> csig prefix for class signatures to be coherent with Typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 15:04:03 +00:00
Alain Frisch 525ef9d703 Synchronize with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Alain Frisch 96fc2316ed Fix #5965.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13619 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-29 15:39:00 +00:00
Alain Frisch bfc9a8f9e1 Get rid of the location argument on pci_params, and improve location of error messages.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13534 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 07:51:27 +00:00
Alain Frisch 152255e512 First version with attributes and extensions on expressions, type expressions and structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13330 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-02-28 16:51:59 +00:00
Jacques Garrigue 26e1ff7138 Merge short-paths into a fresh branch of trunk.
Also fix a bit unification and subtyping errors.
You now need the flag -short-path to activate short paths.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths-4.01@13285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-29 14:21:12 +00:00
Jacques Garrigue d573c40608 Fix PR#5865
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13161 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-27 02:34:49 +00:00
Jacques Garrigue 57c80844f5 add spellchecking for Wrong_name
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/record-disambiguation@13057 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-01 03:32:34 +00:00
Jacques Garrigue 8fac736f31 clean up and merge the patch disambiguate-with-warning from PR#5759
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/record-disambiguation@13048 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-29 07:54:06 +00:00
Alain Frisch 0b37b27356 Stop keeping a Path.t to refer to labels and constructors in the Typedtree AST. This is not used internally and it is not a robust way to identify these objects unambiguously anyway
(especially when we will add more powerful disambiguation strategies).  The correct way to identify an item is through the pair (type,name), which can be deduced from the
label_description/constructor_description stored in the Typedtree.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13043 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-24 12:03:00 +00:00
Alain Frisch e7546ca216 PR#5768: On 'unbound identifier' errors, use spell-checking to suggest names present in the environment.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13018 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-16 13:54:24 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Jacques Garrigue 35185d610b merge version/4.00 at revision 12866
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-08-21 07:10:35 +00:00
Jacques Garrigue d8f8f9ee3b keep the text width to 80 columns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-31 08:07:31 +00:00
Fabrice Le Fessant d39d43e55f merge with branch bin-annot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-30 14:52:37 +00:00
Jacques Garrigue f186ac5cb8 disable shortening for errors in Typetexp
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12076 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-24 05:33:50 +00:00
Jacques Garrigue 477b2dd743 propagate path-expansion environment everywhere
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-23 07:59:45 +00:00
Alain Frisch ece3353035 #5358: package types allow constraints on typed in sub-modules. Camlp4 compiles but does not support this new feature yet.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11311 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-14 10:26:15 +00:00