summaryrefslogtreecommitdiff
path: root/typing/typeclass.mli
Commit message (Collapse)AuthorAgeFilesLines
* Print the type variable that cannot be generalized (#12051)Stefan Muenzel2023-03-271-1/+5
|
* free_vars: use informative typesGabriel Scherer2023-01-011-2/+1
|
* Better error messagesHyunggyu Jang2022-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Add test for error reporting Pacify hygine class_type specific abbrev error report Update test Reflect review Better error message for bad parameters of class type Revert "class_type specific abbrev error report" This reverts commit b8cd3dda44289af0b1766c1ce0d4f895363db132. Fix class type ident for Abbrev_type_clash Add test for Abbrev_type_clash Reflect review: Better error messaging Reflect review: better error message for Bad_parameters
* Remove hash type encodingHyunggyu Jang2022-11-091-2/+0
|
* Keep class signature row up-to-dateLeo White2021-07-151-1/+1
| | | | | | Keep the csig_self_row field up-to-date as we add new methods. This seems more correct and should be slightly more efficient in the common case.
* Remove private_self and public_selfLeo White2021-07-131-0/+1
| | | | | | | | | Now that private methods are stored in the method table there is no need to distinguish `private_self`, `public_self` and `self_type` in `Typeclass.class_structure`. This required extending `Ctype.filter_method` to handle the case of filtering a private method from a closed object type -- which brings the function into line with the equivalent call to `Ctype.unify`.
* Give more precise errors for virtual methodsLeo White2021-07-131-3/+7
| | | | | | | Previously, the check that a non-virtual class did not have virtual methods was delayed until the last stage of type-checking the class. Now we do those checks more eagerly allowing for clearer errors, especially in common cases.
* Change representation of class typesLeo White2021-07-131-2/+3
| | | | | | | | | | Previously, class types represented their methods via the csig_self field. This was a type_expr that was restricted to be syntactically a Tobject node. With this patch the methods are represented directly with a methods table. csig_self is no longer restricted to be a Tobject node and is no longer required to contain the private methods. We also add a csig_self_row field to hold the row variable of the class type -- which means we can avoid going through csig_self to find it.
* Use the new structured errors (#10170) for better error messagesAntal Spector-Zabusky2021-06-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now produce more detailed error messages during various kinds of module inclusion, taking advantage of the new structured error trace generation from #10170. Previously, these errors were "shallow", ending as soon as there was an incompatibility; this patch makes them "deep", reporting the *reasons* for those problems. For example, consider the following module: module M : sig val x : bool * int end = struct let x = false , "not an int" end This now produces the following error: Error: Signature mismatch: Modules do not match: sig val x : bool * string end is not included in sig val x : bool * int end Values do not match: val x : bool * string is not included in val x : bool * int The type bool * string is not compatible with the type bool * int Type string is not compatible with type int The last two lines are new in this patch. Previously, the error message stopped two lines earlier, omitting the key detail that the reason there is an error is specifically that `string` is not equal to `int`.
* Maintain more structural information in type-checking errorsAntal Spector-Zabusky2021-05-061-6/+6
| | | | | | | | | | | | | | | | | | | | This commit refactors the types that make up type-checking errors to maintain more structural information. Most significantly, we split out the errors we get from unification, moregen, and type equality in `Ctype` into three distinct exceptions, and retain the sorts of information we keep during unification in the other two cases as well (no more `Unify []`). We also maintain more information in `Includecore` about mismatches of primitives, manifests, and private objects and variants This commit doesn't make a lot of changes to the user-visible error messages yet, only what's necessary to support the type changes, but it enables a forthcoming patch where we use this improvement to produce more informative error messages. This commit includes existing work by Mekhrubon Tuarev, who did all the early development. I (Antal Spector-Zabusky) came and built the layer of types on top.
* Extend `open` to arbritrary module expressions in structures and toRunhang Li2018-11-261-0/+6
| | | | applicative module paths in signatures
* a type for unification tracesFlorian Angeletti2018-10-171-6/+6
|
* remove unreachable error: Make_seltype_nongenoctachron2018-05-041-1/+0
|
* do not close objects which have been unified with an outer self typeThomas Refis2018-03-061-0/+1
|
* MPR#7237 change 12-tuples in typeclass into record.lijunsong2016-04-291-20/+30
|
* Update headers for the new license.Damien Doligez2016-02-181-11/+14
| | | | Remains to be done: remove all headers in testsuite/tests.
* exhauce PR#6367: introduce Asttypes.arg_label to encode labelled argumentsJacques Garrigue2014-12-221-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* #6399: protocol (based on a built-in ocaml.error extension node) to let ppx ↵Alain Frisch2014-05-071-1/+1
| | | | | | 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
* #6182: better error message for virtual objects and class types.Alain Frisch2013-09-171-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14155 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Synchronize with trunk.Alain Frisch2013-07-161-0/+1
|\ | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| * #6035: reject multiple declarations of the same method or instance variable ↵Alain Frisch2013-06-071-0/+1
| | | | | | | | | | | | in the same object. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | Attributes and extension points in class_expr.Alain Frisch2013-04-101-0/+1
|/ | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Merge short-paths into a fresh branch of trunk.short-paths-4.01Jacques Garrigue2013-01-291-2/+2
|\ | | | | | | | | | | | | | | | | 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
| * merge version/4.00 at revision 12866Jacques Garrigue2012-08-211-11/+42
| | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| * first attempt: handles only unification errorsJacques Garrigue2012-01-221-2/+2
| | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/short-paths@12065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | remove all $Id keywordsDamien Doligez2012-10-151-2/+0
| | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | merge with branch bin-annotFabrice Le Fessant2012-05-301-11/+42
|/ | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* renaming of Objective Caml to OCaml and cleanup of copyright headersDamien Doligez2011-07-271-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Error narrowing for class type lookups.Alain Frisch2010-05-181-1/+0
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Cleanup.Alain Frisch2010-05-181-1/+0
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10421 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* merge branches/overrideJacques Garrigue2010-04-081-0/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10250 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* add virtual instance variablesJacques Garrigue2006-04-051-2/+3
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* exportJacques Garrigue2003-12-011-0/+2
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5989 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* fast and compact classesJacques Garrigue2003-11-251-0/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5977 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Merge branch with recursive modulesXavier Leroy2003-06-191-0/+6
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5602 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* collapse conjunctive types in class definition parametersJacques Garrigue2002-10-081-0/+2
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5163 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* allow coercions from self to own class (when safe!)Jacques Garrigue2001-11-051-0/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3978 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Revu les impressions du compilateurPierre Weis2000-03-061-2/+3
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2908 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Merge olabl branchJacques Garrigue1999-11-301-0/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2651 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Changement de la licenceXavier Leroy1999-11-171-1/+2
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Bug...Jérôme Vouillon1998-08-171-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2074 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Variables non generalisables dans les classesJérôme Vouillon1998-08-171-0/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2072 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Nouvelle syntaxe des classesJérôme Vouillon1998-06-241-27/+36
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1997 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Les parametres des constructeurs de types peuvent etresJérôme Vouillon1997-02-201-1/+1
| | | | | | | | contraints. Par exemple : type 'a t = 'b * 'c constraint 'a = 'b -> 'c git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Type de methode maintenant optionnel dans interface de classe (permetJérôme Vouillon1996-10-261-0/+1
| | | | | | | de passer de virtual a method sans avoir a preciser le type). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1110 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Decoupage du module Typedtree en deux: Types et Typedtree.Xavier Leroy1996-09-231-1/+1
| | | | | | | Sauver l'environnement de typage en plus du type dans les a.s.t. de Typedtree. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1008 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Amelioration de quelques messages d'erreur.Jérôme Vouillon1996-05-261-1/+2
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@840 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Amelioration des messages d'erreurs d'unification (expansion desJérôme Vouillon1996-05-201-4/+4
| | | | | | | | abbreviations). Typeclass: correction d'un bug de typage. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Renommage en Objective CamlXavier Leroy1996-04-301-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Extension objets.Jérôme Vouillon1996-04-221-0/+53
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02