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 error message for invalid use of interface with type constraints #50837
changed the title [-]compiler?: Improve interface with type constraint compilation error[/-][+]cmd/compile: improve error message for invalid use of interface with type constraints[/+]on Jan 26, 2022
The checker.varType function needs a context string so that it can report a context-aware error. Straight-forward to fix, needs some Fingerspitzengefühl for good error messages.
./prog.go:8:21: cannot use type C outside a type constraint: interface contains type constraints
./prog.go:11:4: cannot use type C outside a type constraint: interface contains type constraints
not great, but a bit clearer. Closing this for now.
Activity
[-]compiler?: Improve interface with type constraint compilation error[/-][+]cmd/compile: improve error message for invalid use of interface with type constraints[/+]ianlancetaylor commentedon Jan 26, 2022
CC @griesemer
griesemer commentedon Jan 27, 2022
The
checker.varTypefunction needs a context string so that it can report a context-aware error. Straight-forward to fix, needs some Fingerspitzengefühl for good error messages.griesemer commentedon Jun 23, 2022
This reports now:
not great, but a bit clearer. Closing this for now.