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

cmd/compile: internal compiler error: missing type [Go 1.18 Beta 2] #51360

Closed
dp-arri opened this issue Feb 25, 2022 · 6 comments
Closed

cmd/compile: internal compiler error: missing type [Go 1.18 Beta 2] #51360

dp-arri opened this issue Feb 25, 2022 · 6 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dp-arri
Copy link

dp-arri commented Feb 25, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18beta2 darwin/amd64

Does this issue reproduce with the latest release?

No.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/puettma/Library/Caches/go-build"
GOENV="/Users/puettma/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/puettma/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/puettma/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/puettma/sdk/go1.18beta2"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/puettma/sdk/go1.18beta2/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18beta2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/puettma/dev/experiments/tmp/go18betabug/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_3/h09lh98n15n211s4zkj8cw258f016f/T/go-build840956101=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://go.dev/play/p/u5yZjTiK8aF?v=gotip

What did you expect to see?

./prog.go:6:13: use of builtin cap not in function call

What did you see instead?

./prog.go:6:13: internal compiler error: missing type for &{0xc00038af60 [0xc00038af90] false {{{0xc00038af30 6 13}}}} (*syntax.CallExpr)

@ALTree
Copy link
Member

ALTree commented Feb 25, 2022

Thanks for reporting this. Tentatively putting it in the 1.18 milestone with no relblocker label since the compiler is crashing on an invalid program.

cc @danscales @griesemer

@ALTree ALTree added this to the Go1.18 milestone Feb 25, 2022
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 25, 2022
@mvdan
Copy link
Member

mvdan commented Feb 25, 2022

This is perhaps stating the obvious, but have you tried with go1.18rc1 or Go master (https://pkg.go.dev/golang.org/dl/gotip)? beta2 is nearly a month old at this point.

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 25, 2022
@griesemer griesemer self-assigned this Feb 25, 2022
@griesemer griesemer added NeedsFix The path to resolution is known, but the work has not been done. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 25, 2022
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 25, 2022
@griesemer
Copy link
Contributor

@mvdan It fails on the tip playground which is basically up-to-date. So this is definitively a type-checker bug. Must be some trivial oversight given that this just passes. Sigh.

@mvdan
Copy link
Member

mvdan commented Feb 25, 2022

I hadn't noticed the gotip URL parameter in the playground link, good point :)

@griesemer
Copy link
Contributor

Looks like some error is supressed where it shouldn't.

package p

func _() {
        len.Println()
}

Trace:

testdata/manual.go2:3:6:        -- func _
testdata/manual.go2:3:10:       -- _: func()
testdata/manual.go2:4:20:       -- expr len.Println()
testdata/manual.go2:4:12:       .  -- expr len.Println
testdata/manual.go2:4:9:        .  .  -- expr len
testdata/manual.go2:4:9:        .  .  => len (built-in)
testdata/manual.go2:4:12:       .  => len.Println (invalid operand)
testdata/manual.go2:4:20:       => len.Println() (invalid operand)

@gopherbot
Copy link

Change https://go.dev/cl/388054 mentions this issue: types2: report an error if built-ins are not called in all cases

@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants