-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
commit 34f7622
The following program panics instead of producing a type-check error.
package main
func main() {
NewS().M()
}
type S struct {}
func NewS(type T)() *S {
return nil
}
func (c *S(T)) M() {}
The panic traceback is:
panic: internal error: receiver type parameter inference failed [recovered]
panic: internal error: receiver type parameter inference failed
goroutine 1 [running]:
go/types.(*Checker).handleBailout(0xc00007c7e0, 0xc0000cbbe0)
/usr/local/go-faketime/src/go/types/check.go:251 +0x98
panic(0x6498a0, 0x6db6e0)
/usr/local/go-faketime/src/runtime/panic.go:969 +0x175
go/types.(*Checker).selector(0xc00007c7e0, 0xc000072740, 0xc00000c240)
/usr/local/go-faketime/src/go/types/call.go:534 +0x25b7
go/types.(*Checker).exprInternal(0xc00007c7e0, 0xc000072740, 0x6e3a20, 0xc00000c240, 0x0, 0x0, 0x0)
/usr/local/go-faketime/src/go/types/expr.go:1320 +0x29cc
go/types.(*Checker).rawExpr(0xc00007c7e0, 0xc000072740, 0x6e3a20, 0xc00000c240, 0x0, 0x0, 0x0)
/usr/local/go-faketime/src/go/types/expr.go:1033 +0xc5
go/types.(*Checker).exprOrType(0xc00007c7e0, 0xc000072740, 0x6e3a20, 0xc00000c240)
/usr/local/go-faketime/src/go/types/expr.go:1717 +0x55
go/types.(*Checker).call(0xc00007c7e0, 0xc000072740, 0xc0000722c0, 0x0)
/usr/local/go-faketime/src/go/types/call.go:17 +0x69
go/types.(*Checker).exprInternal(0xc00007c7e0, 0xc000072740, 0x6e32a0, 0xc0000722c0, 0x0, 0x0, 0x38)
/usr/local/go-faketime/src/go/types/expr.go:1569 +0x1dd0
go/types.(*Checker).rawExpr(0xc00007c7e0, 0xc000072740, 0x6e32a0, 0xc0000722c0, 0x0, 0x0, 0x0)
/usr/local/go-faketime/src/go/types/expr.go:1033 +0xc5
go/types.(*Checker).stmt(0xc00007c7e0, 0x0, 0x6e3520, 0xc00001c500)
/usr/local/go-faketime/src/go/types/stmt.go:330 +0x3e78
go/types.(*Checker).stmtList(0xc00007c7e0, 0x0, 0xc00001c510, 0x1, 0x1)
/usr/local/go-faketime/src/go/types/stmt.go:125 +0xd1
go/types.(*Checker).funcBody(0xc00007c7e0, 0xc00004a4e0, 0xc00001a3e8, 0x4, 0xc00004a660, 0xc000010b70, 0x0, 0x0)
/usr/local/go-faketime/src/go/types/stmt.go:42 +0x257
go/types.(*Checker).funcDecl.func1()
/usr/local/go-faketime/src/go/types/decl.go:790 +0x67
go/types.(*Checker).processDelayed(0xc00007c7e0, 0x0)
/usr/local/go-faketime/src/go/types/check.go:315 +0x3e
go/types.(*Checker).checkFiles(0xc00007c7e0, 0xc00003dcb8, 0x1, 0x1, 0x0, 0x0)
/usr/local/go-faketime/src/go/types/check.go:283 +0x145
go/types.(*Checker).Files(...)
/usr/local/go-faketime/src/go/types/check.go:256
go/types.(*Config).Check(0xc0000724c0, 0xc00001a3e0, 0x4, 0xc000072240, 0xc00003dcb8, 0x1, 0x1, 0xc000055360, 0x0, 0x4b702f, ...)
/usr/local/go-faketime/src/go/types/api.go:387 +0x188
go/go2go.RewriteBuffer(0xc00004a3c0, 0x7ffc90c44dec, 0x1e, 0xc0000ba000, 0x7b, 0x27b, 0x0, 0xc000010a50, 0xc000010a20, 0xc0000109f0, ...)
/usr/local/go-faketime/src/go/go2go/go2go.go:137 +0x24f
main.translateFile(0xc00004a3c0, 0x7ffc90c44dec, 0x1e)
/usr/local/go-faketime/src/cmd/go2go/translate.go:26 +0xa9
main.main()
/usr/local/go-faketime/src/cmd/go2go/main.go:65 +0x2f6
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.