| Anonymous | Login | Signup for a new account | 2013-05-23 01:38 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005874 | OCaml | OCaml typing | public | 2013-01-05 23:41 | 2013-05-10 16:50 | ||||||
| Reporter | hongboz | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||
| Status | new | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| 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 Thanks! | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0008700) gasche (developer) 2013-01-06 15:41 |
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. |
|
(0008701) hongboz (developer) 2013-01-06 18:33 |
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).. |
|
(0009266) hongboz (developer) 2013-05-10 16:47 |
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) |
|
(0009268) hongboz (developer) 2013-05-10 16:50 |
Other analysis would help suppose type a = big_type list while 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 |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 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 |