rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Better error message for missing methods on objects

Open amiralies opened this issue 4 years ago • 3 comments

They are called fields in docs. I think we should call them fields in errors too. for example. This error

This expression has type user, it has no method lastName

should be

This expression has type user, it has no field lastName

amiralies avatar Jun 19 '21 10:06 amiralies

Looks like it only need to modify these two lines, Am I right? https://github.com/rescript-lang/syntax/blob/master/compiler-libs-406/typecore.ml#L4985 https://github.com/rescript-lang/syntax/blob/master/compiler-libs-406/typecore.ml#L4991

yanchen036 avatar Oct 05 '22 14:10 yanchen036

In the rescript-compiler repo not here.

cristianoc avatar Oct 05 '22 15:10 cristianoc

I think this can be closed. These messages no longer read like that in master.

mvaled avatar Nov 21 '23 12:11 mvaled