-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
The Go compiler at tip accepts this function
func baz[T [2]int | *[2]int](x []int) {
y := T(x)
fmt.Printf("%T\n", y)
}
but x/tools/go/ssa fails to build a generic function for it:
panic: in command-line-arguments.baz: cannot convert *t0 ([]int) to T
goroutine 1 [running]:
golang.org/x/tools/go/ssa.emitConv(0xc00073ef00, {0x747e20, 0xc00011df80}, {0x745570?, 0xc00021de30})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/emit.go:293 +0xa4c
golang.org/x/tools/go/ssa.(*builder).expr0(0xc000295bc8, 0xc00073ef00, {0x745ac8?, 0xc000328400?}, {0x7, {0x745570, 0xc00021de30}, {0x0, 0x0}})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:677 +0x765
golang.org/x/tools/go/ssa.(*builder).expr(0xc00011df20?, 0xc00073ef00, {0x745ac8, 0xc000328400})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:625 +0x17b
golang.org/x/tools/go/ssa.(*builder).assign(0xc00073ef00?, 0xc00073ef00?, {0x7466e8?, 0xc000750780}, {0x745ac8?, 0xc000328400?}, 0x5b?, 0xc000295520)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:598 +0x3db
golang.org/x/tools/go/ssa.(*builder).assignStmt(0xc000295570?, 0xc00073ef00, {0xc000232360, 0x1, 0x4bf1de?}, {0xc000232380, 0x1, 0x0?}, 0x1)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:1205 +0x3d4
golang.org/x/tools/go/ssa.(*builder).stmt(0xc000295758?, 0xc00073ef00, {0x745948?, 0xc000328440?})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2181 +0x425
golang.org/x/tools/go/ssa.(*builder).stmtList(0xc000295701?, 0xc000750750?, {0xc00021e6c0?, 0x2, 0xc000233d20?})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:946 +0x45
golang.org/x/tools/go/ssa.(*builder).stmt(0xc00073ef00?, 0xc00073ef00, {0x745a68?, 0xc00021c750?})
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2277 +0x859
golang.org/x/tools/go/ssa.(*builder).buildFunctionBody(0x634831?, 0xc00073ef00)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2391 +0x437
golang.org/x/tools/go/ssa.(*builder).buildFunction(0x634880?, 0xc00073ef00)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2326 +0x2e
golang.org/x/tools/go/ssa.(*builder).buildCreated(0xc000295bc8)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2413 +0x25
golang.org/x/tools/go/ssa.(*Package).build(0xc0000e8200)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2606 +0xc86
sync.(*Once).doSlow(0xc000254268?, 0x1?)
/home/dominikh/prj/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/home/dominikh/prj/go/src/sync/once.go:65
golang.org/x/tools/go/ssa.(*Package).Build(...)
/home/dominikh/prj/src/golang.org/x/tools/go/ssa/builder.go:2477
main.doMain()
/home/dominikh/prj/src/golang.org/x/tools/cmd/ssadump/main.go:152 +0xa45
main.main()
/home/dominikh/prj/src/golang.org/x/tools/cmd/ssadump/main.go:65 +0x19
/cc @timothy-king
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.