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
{{ message }}
Repository navigation
cmd/compile: improve "have X want Y" error with additional file and line information #42841
Show also line information (foo.go:123:57) for have line. The implementation might be in completely different file. In modern IDEs you simply can click the file information line to navigate to referenced file and line quickly.
want could also have line information to referenced interface definition line?
./prog.go:14:6: cannot use &myS literal (type *myS) as type S in assignment:
*myS does not implement S (wrong type for DoSomething method)
have DoSomething() (string, error) at ./prog.go:9:28
want DoSomething() (int, error)
What did you see instead?
./prog.go:14:6: cannot use &myS literal (type *myS) as type S in assignment:
*myS does not implement S (wrong type for DoSomething method)
have DoSomething() (string, error)
want DoSomething() (int, error)
changed the title [-]Improve "have X want Y" error with additional file and line information[/-][+]cmd/compile: improve "have X want Y" error with additional file and line information[/+]on Jan 18, 2021
Activity
networkimprov commentedon Dec 5, 2020
cc @mdempsky @griesemer
Seems overlooked by triage?
[-]Improve "have X want Y" error with additional file and line information[/-][+]cmd/compile: improve "have X want Y" error with additional file and line information[/+]ianlancetaylor commentedon Nov 16, 2021
@griesemer Should this stay in the Go1.18 milestone or should we move it to Backlog?
griesemer commentedon Nov 17, 2021
I think this is either done or mostly done (or pending CL). We should keep this for 1.18; I will take care of it.
gopherbot commentedon Dec 21, 2021
Change https://golang.org/cl/373634 mentions this issue:
cmd/compile/types2: add position failed failed interface satisfaction errorodeke-em commentedon Dec 21, 2021
I've mailed a CL for this per https://golang.org/cl/373634.
cmd/compile/types2, go/types: add position for "have" in failed inter…
cmd/compile/types2, go/types: add position for "have" in failed inter…