Commit Graph

221 Commits (master)

Author SHA1 Message Date
Fourchaux 44e6cf4e0f
typos (#9806) 2020-07-28 12:22:03 +01:00
Hongbo Zhang 820db1bd7a
[internal refactor] minor tweaking (#9792) 2020-07-26 19:25:09 +02:00
Thomas Refis 4edc4b9928
pattern aliases do not ignore type constraints (#1655) 2020-07-09 12:20:37 +02:00
Florian Angeletti 4fdba2f638 Merge pull request #9185 from hhugo/fix-unused-open
fix spurious 'unused open' warning with classes and polymorphic variants

(cherry picked from commit d2c4e791fad6340c74abf741af3e79eb1f9c20d7)
2020-01-10 09:49:02 +01:00
Florian Angeletti 816a5088e0 Avoid duplicated mark_loops 2019-10-17 10:03:58 +02:00
Jacques Garrigue 16a13e668b
fix issue #8792 and replace log_type by set_type_desc in Btype (#9018) 2019-10-05 13:17:57 +02:00
Leo White c19e8b2350 Refactor environment lookup functions 2019-08-15 15:56:50 +01:00
Florian Angeletti 6582335689
#8702: fix some polymorphic variant error messages (#8777)
improved error messages for fixed row polymorphic variants: keep track of the motivation behind a fixed row (e.g it was bound to an universal or existential type variable, or private) in the types themselves and use this explanation in error messages.
2019-07-12 17:47:25 +02: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
Leo White 111d4e1827 Remove positions from paths 2018-11-21 03:39:34 -05:00
Alain Frisch 2e5b9d1ef1
"Alerts" as a generalization of "deprecated" (#1804) 2018-11-15 09:51:35 +01:00
alainfrisch 0d968e357b Move variable printer to Pprintast
- The code responsible for printing Syntaxerr errors is moved to the
  Parse module (so that it can depend on the variable printer in
  Pprintast).

- Pprintast becomes a dependency for a few tools that link some
  compiler modules in an ad hoc way (they would better be implemented
  in terms of compiler-libs).
2018-11-06 13:12:54 +01:00
alainfrisch 74b24580ca Fix printing of type variables with a quote on 2nd character
Type variables whose name has a single quote as the second character
(such as ' a' or ' a'b) need to be printed with a whitespace after the
initial quote symbol, in order not to be confused with a character
literal.
2018-11-06 13:12:54 +01:00
Florian Angeletti 3de40984ba a type for unification traces 2018-10-17 17:27:16 +02:00
Florian Angeletti 105553336f improved messages after review 2018-10-12 17:59:15 +02:00
Florian Angeletti 0459e4453b rewording for "constructor has no type" error 2018-10-12 17:54:50 +02:00
Gabriel Scherer 4a95b0b777
Merge pull request #1903 from gasche/add-locations-to-all-attributed-nodes
Parsetree, typedtree: add locations to all nodes carrying attributes
2018-08-22 16:56:28 +02:00
Florian Angeletti 3c780243d4 restore type_variable 2018-08-22 12:30:58 +02:00
Florian Angeletti 1e9d264727 contextualization for unbound type variable error 2018-08-22 12:30:58 +02:00
Florian Angeletti b026bda878
Expanded error message for universal quantification failure (#1993) 2018-08-20 21:08:43 +02:00
Gabriel Scherer e348103ab8 parsetree.{row,object}_field: move attributes in the wrapper record
The concrete syntax only allows attributes on tags/constructors/fields
(Rtag, Otag), not on inherited subtypes (Rinherit, Oinherit); we add
this as new enforced invariant in ast_invariants.
2018-08-20 19:57:47 +02:00
Gabriel Scherer 85785b173a parsetree: make sure that all nodes that store attributes also store a location
Florian Angeletti and myself ran into a problem when trying to use attributes
for ellision of parts of manual example. We wanted to be turn any ast-node
marked with the [@ellipsis] attribute into "..." in the rendering of the
corresponding code block, but for this we need the location of the
attributed node, and it turns out that some constructions supported
attributes without carrying a location:
- Rtag in row_field
- Otag in object_field
- type_exception record
- type_extension record

We added locations in all those positions, guaranteeing the invariant
that all nodes to which attributes can be attached have a precise
position.
2018-08-20 19:57:47 +02:00
Armaël Guéneau c0820e30cb Location: significantly rework the code printing errors and warnings 2018-08-08 17:42:08 +02:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01: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
Florian Angeletti 349db3d869
PR#6416 et al.: injective mapping between identifiers and printed names (#1120) 2018-06-26 22:03:45 +02:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Armaël Guéneau eb4dc7f699 Minor rewording 2018-05-06 10:08:09 +02:00
Armaël Guéneau d9c4a4eb48 Add a breakable space to the "missing rec" hint message 2018-05-06 10:08:09 +02:00
Armaël Guéneau 88b242965d Reword the "missing rec hint" to be less assertive 2018-05-06 10:08:09 +02:00
Armaël Guéneau 7f42ee9276 Allow spellchecking in case of missing rec hint 2018-05-06 10:08:09 +02:00
Armaël Guéneau f0dfd2dc7c Fix fold_values in presence of ghost identifiers
Imported from Xavier Clerc patch in #1678
2018-05-06 10:08:09 +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 7f0e819bde we don't need an env to take instances anymore 2018-02-27 14:52:24 +00: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
Armaël Guéneau 3b77d915b5 Generalize Env.lookup_* functions to allow disabling marking 2017-11-13 20:51:52 +01:00
alainfrisch 893c2bb6df Be more future proof w.r.t. supporting attributes on type parameters. 2017-09-12 00:36:46 +02:00
alainfrisch 8034e26056 Continue. 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
Runhang Li bc32e7a52d
Merge branch 'trunk' into object-inherit 2017-05-22 16:32:24 -07:00
Alain Frisch 1a93a20f37 Merge pull request #1138 from alainfrisch/pr7444_deprecated_warning_upon_inclusion
Deprecation warning when checking signature inclusion
2017-05-15 18:06:31 +02:00
Max Mouratov f49a3966e6 Fixed grammar in error messages 2017-04-06 14:16:18 +02:00
alainfrisch f6d53cc38f Deprecation warning when checking signature inclusion
Deprecation warning (3) is currently only reported when directly
accessing a component marked with the deprecated attribute; but it is
missed when we coerce the signature contaning the deprecated component
to a signature without the attribute.

This commit adds the required machinery to detect such cases
and report the same warning. (An alternative design could be
to introduce a new warning for that purpose.)

Some of the new machinery could be used for other purposes:

  - During the inclusion check, keep the location that would used in
    the error message if the check fails.

  - Warnings can now hold extra "sub-locations" (and associated
    messages).
2017-04-05 19:13:59 +02:00
Runhang Li cb060cd16e
Correct error message, more tests. 2017-03-28 20:48:54 -07:00
Runhang Li d459674326
Unify, rather than copy. 2017-03-26 23:37:13 -07:00
Runhang Li 7743e96e81
Fix bug when handling empty object type exp
Also add tests.
2017-03-23 13:36:34 -07:00
Runhang Li 864b3b735e
Merge branch 'trunk' into object-inherit 2017-03-22 22:13:06 -07:00