|Anonymous | Login | Signup for a new account||2013-05-21 19:09 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005874||OCaml||OCaml typing||public||2013-01-05 23:41||2013-05-10 16:50|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0005874: Improve error message for polymorphic variant|
|Description||Polymorphic variant is really a nice feature, but it's not widely used due to a not very instructive error message (I guess). In most cases, some errors are caused by a typo(the variant name typed wrong, or the arity lost), I think it may not be too hard to give some suggestions instead of a very large error string which may scared the users|
|Tags||No tags attached.|
|Attached Files||tmp.ml [^] (11,727 bytes) 2013-05-10 16:46|
|Regarding typos, I think we could do something along the following lines: when there is an unification mismatch between two variant types, check the labels that appear in one but not the other with the typo-finding algorith, using the set of labels on the other side as dictionary. Maybe this should be restricted to annotation propagation, deciding to trust the annotation rather than the term.|
I agree, the type annotation should help to give a more friendly hint.
And it may be helpful to offer two errors mode, one is abbreviate which provides most useful content, another is verbose mode.
Sometimes the error message I got is like 20 pages long(two module types unification mismatch)..
In some cases, when type a mis-match type b, the compiler simply dumps the two types. Suppose type a is big, the error message is ridiculously large.
Some simple analysis would help a lot, suppose a is a concrete type while b is a function type, the compiler could emit a more friendly error message(see tmp.ml)
Other analysis would help
type a = big_type list
type b = big_type array
when type a mis-matches type b,
the compiler only need tell me one is list the other is array instead of dumping the two types
|2013-01-05 23:41||hongboz||New Issue|
|2013-01-06 15:41||gasche||Note Added: 0008700|
|2013-01-06 18:33||hongboz||Note Added: 0008701|
|2013-05-10 16:46||hongboz||File Added: tmp.ml|
|2013-05-10 16:47||hongboz||Note Added: 0009266|
|2013-05-10 16:50||hongboz||Note Added: 0009268|
|Copyright © 2000 - 2011 MantisBT Group|