Description
When calling a method on a returned value, the error message is incorrect.
Reproduction
type A: struct {
}
func NewA() => A {
return A{}
}
func A.f() {
}
func main {
NewA().f()
}
The current error is:
f is not in method set of A
However, in Go, we would expect the following error:
cannot call pointer method on NewA()
cannot take the address of NewA()
Expected behavior
The error message should be similar to Go’s message, indicating that methods on a pointer receiver cannot be called directly on a returned value. But the current error message could lead to confusion.
Environment
wa-lang version: v0.19.0