-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: Type parameter is not validated in receiver #50316
Comments
Declares a variable of type Similarly in your case, you're declaring the method Dup of #48813 |
@randall77 Thanks for explanation. But if we slightly modify the code:
we get: Looks a little inconsistent. |
I agree it does look a bit strange. But in the latter example you're not defining a new name |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, generics required
What operating system and processor architecture are you using (
go env
)?any
go env
OutputWhat did you do?
Please refer to https://gotipplay.golang.org/p/pyAU-Se4Iqj
What did you expect to see?
A compiler error at line
func (f Foo[string]) Do()
explaining thatstring
is an invalid type parameter value forFoo
What did you see instead?
The program successfully compiled and can be executed. Output:
The text was updated successfully, but these errors were encountered: