We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
n/a
go env
https://go2goplay.golang.org/p/6CjvnnMekvf
package main type Foo interface{} func F(type Foo Foo)() { } func main() { }
Compilation succeeds, or a better error message?
type checking failed for main prog.go2:5:17: Foo is not an interface
The text was updated successfully, but these errors were encountered:
This is expected behavior. It's a consequence of the fact that within a type parameter list, all type parameters are visible throughout the list (https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#mutually-referencing-type-parameters). In (type Foo Foo) the second Foo refers to the first Foo, so it is indeed not an interface type.
(type Foo Foo)
Foo
CC @griesemer in case he sees a way to get a better error message.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?n/a
Does this issue reproduce with the latest release?
n/a
What operating system and processor architecture are you using (
go env
)?n/a
What did you do?
https://go2goplay.golang.org/p/6CjvnnMekvf
What did you expect to see?
Compilation succeeds, or a better error message?
What did you see instead?
The text was updated successfully, but these errors were encountered: