Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005697OCamltypingpublic2012-07-24 10:082015-12-11 19:07
Assigned Tofrisch 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005697: better location info for type errors and/or warnings in sequences & let expressions
DescriptionThe 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 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 ReproduceCompile and examine the location info
in the warning message:

$ ocamlc
File "", line 5, characters 2-176:
Warning 5: this function application is partial,
maybe some arguments are missing.
Additional InformationPatch is in included file

Improved output refers to only the faulty subexpression:

$ ocamlc
File "", line 10, characters 2-15:
Warning 5: this function application is partial,
maybe some arguments are missing.

* 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.
TagsNo tags attached.
Attached Filesdiff file icon [^] (300 bytes) 2012-07-24 10:08 [Show Content]
? file icon [^] (266 bytes) 2012-07-24 10:26 [Show Content]

- Relationships

-  Notes
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).

Drakken (reporter)
2012-07-24 11:44

Thanks, frisch. What about 4.00?
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:
2012-07-24 10:26 Drakken File Added:
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
2015-12-11 19:07 xleroy Status resolved => closed
2017-02-23 16:45 doligez Category OCaml typing => typing

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker