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: 6580 Reporter:@johnwhitington Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:47:28Z) Resolution: not a bug Priority: normal Severity: minor Version: 4.02.1+dev Target version: 4.02.3+dev Category: ~DO NOT USE (was: OCaml general) Child of:#5903 Monitored by:@gasche
Bug description
Consider, in 4.02 (We need a product version for that in the tracker...)
let f ~(x:bool) y = x
val f : x:bool -> 'a -> bool =
If we omit the parentheses, we get a not terribly useful error:
let f ~x:bool y = x;;
Error: Unbound value x
But worse, if we don't mention 'x' at all in the body, it is given type 'a rather than bool, and we get no error!
let f ~x:bool y = y;;
val f : x:'a -> 'b -> 'b =
These two errors both seem unoptimal and, worse, at odds with one another...
The text was updated successfully, but these errors were encountered:
Yes, the remark about unused variable warnings coming too late is already in #5903.
Unfortunately, currently one needs to typecheck the whole expression before issuing such warning.
Giving the warnings early would require an independent binding analysis.
Original bug ID: 6580
Reporter: @johnwhitington
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:47:28Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 4.02.1+dev
Target version: 4.02.3+dev
Category: ~DO NOT USE (was: OCaml general)
Child of: #5903
Monitored by: @gasche
Bug description
Consider, in 4.02 (We need a product version for that in the tracker...)
let f ~(x:bool) y = x
val f : x:bool -> 'a -> bool =
If we omit the parentheses, we get a not terribly useful error:
let f ~x:bool y = x;;
Error: Unbound value x
But worse, if we don't mention 'x' at all in the body, it is given type 'a rather than bool, and we get no error!
let f ~x:bool y = y;;
val f : x:'a -> 'b -> 'b =
These two errors both seem unoptimal and, worse, at odds with one another...
The text was updated successfully, but these errors were encountered: