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

gccgo: spurious "duplicate method" error with anonymous, recursive interfaces #56061

Open
mdempsky opened this issue Oct 5, 2022 · 0 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Oct 5, 2022

The following package should type check, but gccgo rejects it with a "duplicate method" error:

$ cat q.go
package main

type (
	a interface { m() interface { a; b } }
	b interface { m() interface { a; b } }
)

var _ = new(interface{ a }) == new(interface{ b })

func main() {}

$ gccgo q.go
q.go:4:39: error: duplicate method ‘m’
    4 |         a interface { m() interface { a; b } }
      |                                       ^

/cc @ianlancetaylor

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 5, 2022
@mdempsky mdempsky added this to the Gccgo milestone Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

1 participant