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
On tip (6e50991):
Repro:
package p type Foo[t any] interface { Bar(Bar[t]) } type Bar[t any] interface { Foo }
go build k.go # command-line-arguments panic: assertion failed [recovered] panic: assertion failed goroutine 1 [running]: cmd/compile/internal/types2.(*Checker).handleBailout(0xc0000f4640, 0xc0000cd690) /Users/aram/go/src/cmd/compile/internal/types2/check.go:240 +0x8b panic({0x185a220, 0x1a3b7d0}) /Users/aram/go/src/runtime/panic.go:814 +0x214 cmd/compile/internal/types2.assert(...) /Users/aram/go/src/cmd/compile/internal/types2/errors.go:23 cmd/compile/internal/types2.(*subster).typ(0xc0000cd388, {0x1a49e10, 0xc0000c4a00}) /Users/aram/go/src/cmd/compile/internal/types2/subst.go:191 +0x195a cmd/compile/internal/types2.(*subster).typeList(0x3, {0xc000098bf0, 0x1, 0xc0000f4640}) /Users/aram/go/src/cmd/compile/internal/types2/subst.go:370 +0xaa cmd/compile/internal/types2.(*subster).typ(0xc0000cd388, {0x1a49dc0, 0xc0003b9c20}) /Users/aram/go/src/cmd/compile/internal/types2/subst.go:153 +0xaa5 cmd/compile/internal/types2.(*Checker).subst(0xc0000b64b8, {0xc000372ed0, 0x1, 0x0}, {0x1a49dc0, 0xc0003b9c20}, 0xc0000cd418, 0x174d8d7) /Users/aram/go/src/cmd/compile/internal/types2/subst.go:77 +0x132 cmd/compile/internal/types2.(*Named).expand(0xc0000c4b40, 0x0) /Users/aram/go/src/cmd/compile/internal/types2/named.go:275 +0x185 cmd/compile/internal/types2.(*Named).Underlying(0x1) /Users/aram/go/src/cmd/compile/internal/types2/named.go:159 +0x25 cmd/compile/internal/types2.(*Named).under(0xc0000c4b40) /Users/aram/go/src/cmd/compile/internal/types2/named.go:172 +0x36 cmd/compile/internal/types2.(*Checker).newNamed.func1() /Users/aram/go/src/cmd/compile/internal/types2/named.go:101 +0x25 cmd/compile/internal/types2.(*Checker).processDelayed(0xc0000f4640, 0x0) /Users/aram/go/src/cmd/compile/internal/types2/check.go:307 +0x35 cmd/compile/internal/types2.(*Checker).checkFiles(0xc0000f4640, {0xc0000b6470, 0x0, 0x0}) /Users/aram/go/src/cmd/compile/internal/types2/check.go:272 +0x2c8 cmd/compile/internal/types2.(*Checker).Files(...) /Users/aram/go/src/cmd/compile/internal/types2/check.go:245 cmd/compile/internal/noder.checkFiles({0xc0000b6430, 0x1, 0x203000}) /Users/aram/go/src/cmd/compile/internal/noder/irgen.go:65 +0x43e cmd/compile/internal/noder.check2({0xc0000b6430, 0x1, 0x1}) /Users/aram/go/src/cmd/compile/internal/noder/irgen.go:78 +0x46 cmd/compile/internal/noder.LoadPackage({0xc0000be110, 0x1, 0x0}) /Users/aram/go/src/cmd/compile/internal/noder/noder.go:90 +0x365 cmd/compile/internal/gc.Main(0x1918b50) /Users/aram/go/src/cmd/compile/internal/gc/main.go:190 +0xaf3 main.main() /Users/aram/go/src/cmd/compile/main.go:55 +0xdd
Notice how Bar[t] mistakenly embeds Foo, not Foo[t]. The correct code works.
Bar[t]
Foo
Foo[t]
package p type Foo[t any] interface { Bar(Bar[t]) } type Bar[t any] interface { Foo[t] }
The text was updated successfully, but these errors were encountered:
Likely related to #47887.
Sorry, something went wrong.
This is now fixed, likely with the fix for #47887. Compiling the 1st example correctly reports:
x.go:7:2: cannot use generic type Foo[t interface{}] without instantiation
No branches or pull requests
On tip (6e50991):
Repro:
Notice how
Bar[t]
mistakenly embedsFoo
, notFoo[t]
. The correct code works.The text was updated successfully, but these errors were encountered: