-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
affected/package: compiler #51608
Comments
I can't recreate the problem on tip. Perhaps it has been fixed, or perhaps I don't understand your description. Please show a complete failing example on the Go playground at https://go.dev/play. Click on "Go release" and change it to "Go dev branch" to get the current sources. Thanks. |
the version of Go dev branch is. devel go1.19-5a040c5a36 Thu Mar 10 09:12:04 2022 +0000 in go 1.18
works fine. but in go1.19 my example is
|
This was a late change we made to the language spec and compiler for 1.18. See #51576. |
will you fix the problem in go1.18?
when I call it with
only the second function work ,it is confusing |
I'm sorry, I don't understand exactly what you are saying. The test case https://go.dev/play/p/Ti1vlIRR8HO?v=gotip, which is based on your test case, works for me using the future Go 1.18. Do you have a different test case that fails? |
@xiazemin you must not post screenshots. Please use links to go.dev, or if that is unavailable to you, text. Thank you in advance for your understanding. |
it has been fixed in go1.18rc1 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
the two functions can work as the same
What did you see instead?
Show[Student](st)
works finebut
ShowStudent[Student](st)
not work./gen.go:132:14: Student does not implement Student (Student is not an interface)
The text was updated successfully, but these errors were encountered: