-
Notifications
You must be signed in to change notification settings - Fork 833
Description
What
The following error message is super common and could be made less intimidating:
type Person = { Name : string }
let isaac = { Name = "Isaac" }
let fullName = isaac.Fooo + " Abraham" // The type 'Person' does not define the field, constructor or member 'Fooo'.Why
The error message makes perfect sense, but for the beginner I feel it could be made more welcoming. In addition, the fact that it shows the type rather than the symbol name is a little confusing - especially if that type has been inferred.
How
I would prefer to see an error something like as follows:
isaac.Fooodoes not exist (isaacis typePerson).- Unknown member
isaac.Fooo(isaacis typePerson).
Notice that we use the same symbol name and path as the actual code sample, which hopefully draws people's attention to the source of the issue. In the current error message, you have to read all the way to the end to see what the issue is.
I suppose we could keep the current "type-oriented" message but still improve it e.g.:
Fooodoes not exist on the typePerson.Fooodoes not exist on this symbol, which has typePerson.
I'm not sure when else this error message is shown, so it's possible I've missed some other obvious cases etc.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status