Skip to content

cmd/compile: incorrect type error after "type int64 int32" #38882

@JohnReedLOL

Description

@JohnReedLOL

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

$ go version
go version go1.14.2 darwin/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/john-michaelreed/Library/Caches/go-build"
GOENV="/Users/john-michaelreed/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/john-michaelreed/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/john-michaelreed/sdk/go1.14.2"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/john-michaelreed/sdk/go1.14.2/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/np/j2pvl5cd1mj8gkh66ml36j3m0000gn/T/go-build831703242=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Incorrect Error Message

What did you expect to see?

I expect to see "constant 100000000000 overflows main.int64".
Either that or the line "type int64 int32" shouldn't compile.

What did you see instead?

I see "constant 100000000000 overflows int64". That's incorrect because 100000000000 does not overflow int64. It overflows main.int64. Those are two different types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions