golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmd/compile: internal compiler error: want FUNC, but have int

dvyukov opened this issue · comments

go version devel +8259cf3 Tue Sep 6 21:05:58 2016 +0000 linux/amd64

program:

package main
const(A=complex(0()))
/tmp/test.go:2: internal compiler error: want FUNC, but have int

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0xa7fd11, 0x14, 0xc42043b850, 0x2, 0x2)
    src/cmd/compile/internal/gc/subr.go:165 +0x248
cmd/compile/internal/gc.(*Type).wantEtype(0xc4203c20f0, 0x675913)
    src/cmd/compile/internal/gc/type.go:675 +0xe7
cmd/compile/internal/gc.(*Type).FuncType(0xc4203c20f0, 0xc420060750)
    src/cmd/compile/internal/gc/type.go:208 +0x30
cmd/compile/internal/gc.(*Type).Results(0xc4203c20f0, 0x1)
    src/cmd/compile/internal/gc/type.go:681 +0x2b
cmd/compile/internal/gc.typecheck1(0xc420430a20, 0x2, 0xc420018bd0)
    src/cmd/compile/internal/gc/typecheck.go:1400 +0xad0a
cmd/compile/internal/gc.typecheck1(0xc420430a20, 0x2, 0x2)
    src/cmd/compile/internal/gc/typecheck.go:1215 +0x3c86
cmd/compile/internal/gc.typecheck(0xc420430a20, 0x2, 0x0)
    src/cmd/compile/internal/gc/typecheck.go:188 +0x64a
cmd/compile/internal/gc.typecheckdef(0xc420430750, 0x0)
    src/cmd/compile/internal/gc/typecheck.go:3649 +0x8ee
cmd/compile/internal/gc.typecheck1(0xc420430750, 0x2, 0x1)
    src/cmd/compile/internal/gc/typecheck.go:266 +0xd1ac
cmd/compile/internal/gc.typecheck(0xc420430750, 0x2, 0x0)
    src/cmd/compile/internal/gc/typecheck.go:188 +0x64a
cmd/compile/internal/gc.typecheck1(0xc420430b40, 0x1, 0x57d2b614)
    src/cmd/compile/internal/gc/typecheck.go:2087 +0x6208
cmd/compile/internal/gc.typecheck(0xc420430b40, 0x1, 0x3)
    src/cmd/compile/internal/gc/typecheck.go:188 +0x64a
cmd/compile/internal/gc.Main()
    src/cmd/compile/internal/gc/main.go:368 +0x1836
cmd/compile/internal/amd64.Main()
    src/cmd/compile/internal/amd64/galign.go:93 +0x2fa
main.main()
    src/cmd/compile/main.go:33 +0x2a3

Not urgent.