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: 7093 Reporter: @sliquister Assigned to:@garrigue Status: resolved (set by @garrigue on 2017-03-14T08:19:57Z) Resolution: not a bug Priority: normal Severity: minor Version: 4.02.3 Target version: undecided Category: typing Monitored by:@gasche@diml@hcarty
Bug description
When typing this code:
type a = { a : unit }
type b = a
let f (b : b) = b.typo
the compiler gives this error:
File "a.ml", line 3, characters 18-22:
Error: This expression has type b
The field typo does not belong to type a
There are two confusing things here:
"This expression has type b" despite the position being the record field
which is not an expression
When the type expressions are longer, it's easy to assume the error is the usual "this
expression has type b but an expression was expected of type a", and then get confused.
Can't the error simply be:
File "a.ml", line 3, characters 18-22:
Error: The field typo does not belong to type a
? The first part doesn't seem useful to me.
The text was updated successfully, but these errors were encountered:
I agree that the location may be confusing, but the idea is to locate it on the label (to make clear this is about field acess), while giving also information about the expression itself.
Here the first part is not useful, but in some cases the type of the expression itself may be more complicated.
Maybe there could be a different wording, but not that this error message is already collecting strings from various places...
Original bug ID: 7093
Reporter: @sliquister
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2017-03-14T08:19:57Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 4.02.3
Target version: undecided
Category: typing
Monitored by: @gasche @diml @hcarty
Bug description
When typing this code:
type a = { a : unit }
type b = a
let f (b : b) = b.typo
the compiler gives this error:
File "a.ml", line 3, characters 18-22:
Error: This expression has type b
The field typo does not belong to type a
There are two confusing things here:
which is not an expression
expression has type b but an expression was expected of type a", and then get confused.
Can't the error simply be:
File "a.ml", line 3, characters 18-22:
Error: The field typo does not belong to type a
? The first part doesn't seem useful to me.
The text was updated successfully, but these errors were encountered: