Skip to content

cmd/compile: internal error missing type check #30907

Closed

Description

@jayconrod

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

$ go version
go version devel +c0cfe9687f Thu Mar 14 21:00:20 2019 +0000 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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jayconrod/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jayconrod/go"
GOPROXY=--redacted--
GORACE=""
GOROOT="/Users/jayconrod/Code/go"
GOTMPDIR=""
GOTOOLDIR="/Users/jayconrod/Code/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jayconrod/go/src/gocloud.dev/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rq/x0692kqj6ml8cvrhcqh5bswc008xj1/T/go-build259363876=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ cd ~/go/src
$ git clone https://github.com/google/go-cloud gocloud.dev
$ cd gocloud.dev
$ GO111MODULE=on go test -cover -coverpkg=./... ./blob/azureblob

What did you expect to see?

ok  	gocloud.dev/blob/azureblob	0.666s	coverage: 68.6% of statements in ./...

What did you see instead?

# gocloud.dev/blob/azureblob [gocloud.dev/blob/azureblob.test]
blob/azureblob/azureblob.go:535: internal compiler error: missing typecheck: 
.   AS l(536)
.   .   NAME-uuid..autotmp_1 a(true) l(14) x(0) class(PAUTO) tc(1) used uuid.UUID

goroutine 1 [running]:
runtime/debug.Stack(0x1c03f00, 0xc00009c000, 0x0)
	/Users/jayconrod/Code/go/src/runtime/debug/stack.go:24 +0x9d
cmd/compile/internal/gc.Fatalf(0x1a61921, 0x16, 0xc000b87450, 0x1, 0x1)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/subr.go:190 +0x293
cmd/compile/internal/gc.walkstmt(0xc0009a7a00, 0xc0009a7980)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:154 +0xe9a
cmd/compile/internal/gc.walkstmtlist(0xc000b92800, 0x2d, 0x40)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:79 +0x46
cmd/compile/internal/gc.walkstmt(0xc0005a8680, 0xc0005a8380)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:258 +0x132f
cmd/compile/internal/gc.walkstmtlist(0xc000b92600, 0x2d, 0x40)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:79 +0x46
cmd/compile/internal/gc.walk(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/walk.go:63 +0x3e4
cmd/compile/internal/gc.compile(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/pgen.go:235 +0x80
cmd/compile/internal/gc.funccompile(0xc00058e6e0)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/pgen.go:221 +0xc2
cmd/compile/internal/gc.Main(0x1a7a1c8)
	/Users/jayconrod/Code/go/src/cmd/compile/internal/gc/main.go:665 +0x305a
main.main()
	/Users/jayconrod/Code/go/src/cmd/compile/main.go:51 +0xad

FAIL	gocloud.dev/blob/azureblob [build failed]

Activity

  1. jayconrod commented on Mar 18, 2019

    @jayconrod
    ContributorAuthor

    A bisect pointed to CL 166983 as being the first bad commit on master. Seems related to the error.

    @mdempsky @griesemer Mind taking a look?

  2. self-assigned this
    on Mar 18, 2019
  3. mdempsky commented on Mar 18, 2019

    @mdempsky
    Contributor

    Minimal repro:

    $ cat uuid/uuid.go
    package uuid
    
    type UUID string
    
    func New() UUID {
    	return Must(NewRandom())
    }
    
    func NewRandom() (UUID, error) {
    	return "", nil
    }
    
    func Must(uuid UUID, err error) UUID {
    	return uuid
    }
    
    $ cat p.go
    package p
    
    import "./uuid"
    
    func f() {
    	uuid.New()
    }
    
    $ GO111MODULE=off go build p.go
    # command-line-arguments
    ./p.go:6:10: internal compiler error: missing typecheck: 
    .   AS l(6)
    .   .   NAME-uuid..autotmp_1 a(true) l(6) x(0) class(PAUTO) tc(1) used uuid.UUID
    
  4. gopherbot commented on Mar 18, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/168199 mentions this issue: cmd/compile: fix importing rewritten f(g()) calls

  5. mdempsky commented on Mar 18, 2019

    @mdempsky
    Contributor

    Thanks for the report, @jayconrod!

  6. jayconrod commented on Mar 18, 2019

    @jayconrod
    ContributorAuthor

    Sure, thanks for fixing it so quickly!

  7. gopherbot commented on Sep 13, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/195279 mentions this issue: cmd/go: fix link error for -coverpkg in GOPATH mode

  8. gopherbot commented on Sep 13, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/195281 mentions this issue: [release-branch.go1.13] cmd/go: fix link error for -coverpkg in GOPATH mode

  9. locked and limited conversation to collaborators on Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions