| Anonymous | Login | Signup for a new account | 2013-05-19 02:08 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 | |||||||
| 0005697 | OCaml | OCaml typing | public | 2012-07-24 10:08 | 2012-07-24 11:45 | |||||||
| Reporter | Drakken | |||||||||||
| Assigned To | frisch | |||||||||||
| Priority | low | Severity | tweak | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | 3.12.1 | |||||||||||
| Target Version | Fixed in Version | |||||||||||
| Summary | 0005697: better location info for type errors and/or warnings in sequences & let expressions | |||||||||||
| Description | The type checker currently reports the location of the entire body of a for loop when the body is mistyped, even though the mistake can be located more precisely for sequences and let expressions. The included file fizzbuzz.ml has a for loop whose body contains a double let binding and a four-part sequence. The mistake is in the last part of the sequence, where the call to print_newline is missing its unit argument. (oops! :) The location of the current type warning unnecessarily contains all six lines of the body, including both the let bindings and the entire sequence. | |||||||||||
| Steps To Reproduce | Compile fizzbuzz.ml and examine the location info in the warning message: $ ocamlc fizzbuzz.ml File "fizzbuzz.ml", line 5, characters 2-176: Warning 5: this function application is partial, maybe some arguments are missing. | |||||||||||
| Additional Information | Patch is in included file typecore.ml.diff. Improved output refers to only the faulty subexpression: $ ocamlc fizzbuzz.ml File "fizzbuzz.ml", line 10, characters 2-15: Warning 5: this function application is partial, maybe some arguments are missing. Notes: * The function type_approx does something similar. * type_exp and other functions might also benefit from this. * I have no idea whether the function final_subexpression belongs somewhere else. * Feel free to change the name "final_subexpression" if you don't like it. | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0007799) frisch (developer) 2012-07-24 10:58 edited on: 2012-07-24 11:44 |
Thanks! Committed to trunk (rev 12763), also treating other cases (if, try, match). |
|
(0007800) Drakken (reporter) 2012-07-24 11:44 |
Thanks, frisch. What about 4.00? |
|
(0007801) frisch (developer) 2012-07-24 11:45 |
4.00 is almost out. It's too late to add anything to it, except maybe fixes for serious bugs. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-07-24 10:08 | Drakken | New Issue | |
| 2012-07-24 10:08 | Drakken | File Added: typecore.ml.diff | |
| 2012-07-24 10:26 | Drakken | File Added: fizzbuzz.ml | |
| 2012-07-24 10:50 | frisch | Assigned To | => frisch |
| 2012-07-24 10:50 | frisch | Status | new => assigned |
| 2012-07-24 10:58 | frisch | Note Added: 0007799 | |
| 2012-07-24 10:58 | frisch | Status | assigned => resolved |
| 2012-07-24 10:58 | frisch | Resolution | open => fixed |
| 2012-07-24 11:44 | Drakken | Note Added: 0007800 | |
| 2012-07-24 11:44 | frisch | Note Edited: 0007799 | View Revisions |
| 2012-07-24 11:45 | frisch | Note Added: 0007801 | |
| Copyright © 2000 - 2011 MantisBT Group |