Skip to content
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

go/parser: incorrectly allows parenthesized embedded types #51655

Open
findleyr opened this issue Mar 14, 2022 · 1 comment
Open

go/parser: incorrectly allows parenthesized embedded types #51655

findleyr opened this issue Mar 14, 2022 · 1 comment
Labels
NeedsFix
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Mar 14, 2022

What version of Go are you using (go version)?

$ go version
go version go1.17.8 linux/amd64

Does this issue reproduce with the latest release?

Yes, and at tip.

What did you do?

https://go.dev/play/p/xOwV_SZwGCU

Parsed this

package p

type I1 interface{}

type I2 struct{ (I1) }

What did you expect to see?

An error

What did you see instead?

No error

I believe in the process of adding support for generics, we accidentally dropped this error. This has been present since at least Go 1.17, so (IMO) should be OK to fix in a patch release of Go 1.18, backported to Go 1.17.

CC @griesemer

@findleyr findleyr added the NeedsFix label Mar 14, 2022
@findleyr findleyr added this to the Go1.18 milestone Mar 14, 2022
@findleyr findleyr removed this from the Go1.18 milestone Mar 14, 2022
@findleyr findleyr added this to the Go1.19 milestone Mar 14, 2022
@griesemer
Copy link
Contributor

@griesemer griesemer commented Mar 14, 2022

The compiler correctly reports this error, so I am not too concerned about the need for back-porting. Actually running code won't have this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants