-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go2go: panic if using generic type with badly defined method as an interface #39664
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
Comments
The code is incorrect but the type checker should return an error rather than panicking. |
My thoughts exactly. Was a bit confused when it happened. Thought it was a runtime error in my code. |
Simpler reproducer: package p
type T(type _) struct {}
func (T) m()
func _() {
var x interface { m() }
x = T(int){}
_ = x
} |
The error is actually reported, but the type-checker dies later. |
Change https://golang.org/cl/238625 mentions this issue: |
…type parameters Fixes #39664. Change-Id: I0cf585f0c704bdaa163a7ebc9e7c82a734fcd5e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/238625 Reviewed-by: Robert Griesemer <[email protected]>
Fixed in dev.go2o branch. |
Playground
Output:
The text was updated successfully, but these errors were encountered: