Thomas Refis
167e66e15d
type_cases: rely on levels to enforce principality ( #1931 )
...
Instead of the erasure scheme that was used up to now, where we
considered that the type was always principal.
Note: the erasure still happens when polymorphic variants appear in the
patterns, and the type of the scrutinee contains a Reither.
2020-07-08 10:35:40 +02:00
Jacques Garrigue
24d087325c
Fix #7902 : Type-checker infers a recursive type, even though -rectype… ( #9556 )
2020-06-15 10:26:26 +02:00
Jacques Garrigue
abb8db459d
Fix #7520 : Odd behaviour of refutation cases with polymorphic variants ( #9547 )
2020-06-03 17:47:12 +02:00
octachron
9fe4b963cb
import Jacques comment on flatten_fields from the issue tracker
2020-05-18 11:37:40 +02:00
Leo White
c272447b1e
Relax the handling of explicit polymorphic types
2020-01-20 13:48:16 +00:00
Jeremie Dimino
2d31ebfc8b
Add support for [@@immediate64]
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01: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
Jacques Garrigue
d32550f5fb
Fix #8550 : Soundness issue with class generalization ( #8552 )
...
* also rename generalize_expansive -> lower_contravariant
2019-04-09 15:03:19 +09:00
Jules Aguillon
109f0b2b34
Add the explain function to Ctype.Unification_trace
2019-03-08 16:37:49 +01:00
Florian Angeletti
c8a15cf006
bugfix: restore "self cannot be closed" error message
2019-02-27 14:06:51 +01:00
Fourchaux
1946594bd7
Fixing typos in various files ( #2246 )
...
Note: Typos found with https://github.com/codespell-project/codespell
Here is the (semi-manual) command used to get (and correct) the typos:
$ codespell -i 3 -w --skip=".png,.gif,./ocaml/boot,./ocaml/.git,./ocaml/manual/styles,./ocaml/manual/manual/htmlman" -L minimise,instal,contructor,"o'caml",cristal,pres,clos,cmo,uint,iff,te,objext,nto,nd,mut,upto,larg,exten,leage,mthod,delte,tim,atleast,langage,hten,iwth,mke,contant,succint,methids,eles,valu,clas,modul,que,classe,missings,froms,defaut,correspondance,differents,configury,reachs,cas,approche,normale,dur,millon,amin,oje,transfert
2019-02-13 14:04:56 +01:00
Florian Angeletti
e8bdc6af67
unification trace: properly track universal variable renaming ( #2135 )
...
* unification trace: track univar renaming
This PR fixes an inconsistency introduced by #2047 : when an universal type variable was renamed in Printtyp, the explanation part of the error message kept the original name leading to potentially confusing error messages.
This PR fixes this inconsistency by keeping the whole type expression in the explanation part of the unification message instead of just its original name (and add a test for this behavior).
2018-11-06 09:33:47 +01:00
Thomas Refis
4a6f33d557
make check_scope_escape behave more like update_level
2018-10-18 10:52:50 +01:00
Florian Angeletti
ca043e91ef
unification trace: reify object error earlier
2018-10-17 17:34:47 +02:00
Florian Angeletti
233d66611c
Add context for unification errors
2018-10-17 17:31:31 +02:00
Florian Angeletti
3de40984ba
a type for unification traces
2018-10-17 17:27:16 +02:00
Thomas Refis
e452ac15ab
create a new scope whenever we create new scoped idents
2018-09-21 11:48:46 -04:00
Thomas Refis
edf310ec28
properly scope idents
...
- when including: the elements are rescoped to the current level (as
well as being given a fresh stamp, which was already the case)
- extension constructors idents cannot be local: they can be used as
types when the constructor's argument is an inlined record. They must be
given a scope
- in check_recmod_inclusion: create a new scope at each iteration
- when checking that type declarations inside recursive modules are well
founded, we now take a generic instance of the declaration (this is
reminiscent of what is done in Ctype.moregeneral)
2018-09-21 11:47:44 -04:00
Thomas Refis
35006b9d88
ctype: remove unused function
2018-08-07 09:10:46 +01:00
Thomas Refis
2403ffb1b5
typemod: allow items coming from includes to be shadowed
2018-07-25 13:06:38 +01:00
Thomas Refis
06d96c6260
nondep_type_*: take an ident list
2018-07-25 12:48:10 +01:00
Thomas Refis
445b53182a
ctype: remove instance_def which is redundant
2018-07-25 11:12:10 +01:00
Thomas Refis
555f8387c1
stop calling Ctype.unroll_abbrev
2018-07-10 10:04:34 +01:00
Florian Angeletti
18bba745f3
typing: remove an unused error
2018-06-29 17:38:38 +02:00
David Allsopp
b5d1929e87
Whitespace and overlong line fixes.
2018-06-14 15:15:34 +01:00
octachron
1ecf7ea486
change unexpected existentials error message
2018-04-25 17:57:14 +02: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
7f0e819bde
we don't need an env to take instances anymore
2018-02-27 14:52:24 +00:00
Thomas Refis
68da72c265
enrich_typedecl: don't enrich incompatible decls
2018-02-08 10:23:04 +00:00
Fourchaux
72cfdd56e9
Typos and basic grammar error fixing ( #1280 )
2017-08-10 11:59:23 +01:00
Jacques Garrigue
240fde10ac
Fix PR#7269 again, cancelling previous fix
2016-06-03 16:50:28 +09:00
Sébastien Hinderer
50147913ac
Call the '#' sign hash rather than sharp.
2016-05-09 16:34:40 +02:00
alainfrisch
502e4f9336
More warnings when compiling the compiler.
2016-03-15 22:46:35 +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
Will Crichton
50dd38d4b6
Add support for immediate attribute
2016-02-02 11:45:07 +00:00
Jacques Garrigue
9229b15aaa
Fix PR#6980 and remove unused Ctype.iterative_generalization
2015-11-30 13:49:30 +09:00
Jacques Garrigue
ce552ccf20
Fix performance problem with PR#7016 and strengthen code
2015-11-16 16:38:08 +09: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
Jacques Garrigue
8873757fb1
partial fix of PR#5780
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16411 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-09 08:51:02 +00:00
Leo White
5c55e4cc08
Attach documentation comments to Parsetree
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16189 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-28 13:11:50 +00:00
Jacques Garrigue
c88f3d0634
Improved exhaustiveness warnings for GADTs, with non-deterministic in type_pat
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16133 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-19 22:52:21 +00:00
Jacques Garrigue
ebbf345d29
Fix PR#5663: program rejected due to nongeneralizable type variable that appears nowhere
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16029 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-22 07:12:49 +00:00
Jacques Garrigue
aa5422cdeb
Fix PR#5545, cleaner use of generalize_spine
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-25 23:25:52 +00:00
Jacques Garrigue
158480371a
exhauce PR#6367: introduce Asttypes.arg_label to encode labelled arguments
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 08:45:55 +00:00
Damien Doligez
cbfe627f92
merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +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
d59bd570d7
Structural typing of first class modules (cf. PR#6333)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 02:06:10 +00:00