You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5697 Reporter: Drakken Assigned to:@alainfrisch Status: closed (set by @xavierleroy on 2015-12-11T18:07:24Z) Resolution: fixed Priority: low Severity: tweak Version: 3.12.1 Category: typing
Bug 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.
Original bug ID: 5697
Reporter: Drakken
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2015-12-11T18:07:24Z)
Resolution: fixed
Priority: low
Severity: tweak
Version: 3.12.1
Category: typing
Bug 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:
belongs somewhere else.
you don't like it.
File attachments
The text was updated successfully, but these errors were encountered: