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: 7221 Reporter:@whitequark Status: acknowledged (set by @damiendoligez on 2017-04-14T14:37:08Z) Resolution: open Priority: normal Severity: feature Version: 4.03.0+dev / +beta1 Category: typing Monitored by:@gasche@hcarty
Bug description
Let's look at this case:
# let f a b = ();;
val f : 'a -> 'b -> unit = <fun>
# f 1; ();;
Characters 0-3:
Warning 5: this function application is partial, maybe some arguments are missing.
So far so good. Now let's look at this case:
# let g x = x + 1;;
val g : int -> int = <fun>
# g (f 1);;
Error: This expression has type 'a -> unit but an expression was expected of type int
This isn't too bad too, but this can be much improved by detecting that a partial application was lexically present in a context where a non-function type was inferred, and adding "maybe some arguments are missing" to this one as well.
An additional incentive to fix this is that this class of bug is a very common novice problem, especially for people unaccustomed with currying.
The text was updated successfully, but these errors were encountered:
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 7221
Reporter: @whitequark
Status: acknowledged (set by @damiendoligez on 2017-04-14T14:37:08Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @gasche @hcarty
Bug description
Let's look at this case:
So far so good. Now let's look at this case:
This isn't too bad too, but this can be much improved by detecting that a partial application was lexically present in a context where a non-function type was inferred, and adding "maybe some arguments are missing" to this one as well.
An additional incentive to fix this is that this class of bug is a very common novice problem, especially for people unaccustomed with currying.
The text was updated successfully, but these errors were encountered: