You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go run main.go
# github.com/mh-cbon/gigo/interpreter/glang
interpreter/glang/glang.go:802: use of builtin close not infunctioncall
interpreter/glang/glang.go:830: use of builtin close not infunctioncall
interpreter/glang/glang.go:1274: ret.Init undefined (type *"github.com/mh-cbon/gigo/struct/glang".BranchedStmtBlock has no field or method Init)
interpreter/glang/glang.go:1282: ret.Body undefined (type *"github.com/mh-cbon/gigo/struct/glang".BranchedStmtBlock has no field or method Body)
interpreter/glang/glang.go:1284: undefined: Body
What did you expect to see?
That the type checker detect the use of a reserved keyword into
that call expression and assume it is either,
It happened because i copy pasted code and forgot to duplicate the close var declaration.
What did you see instead?
I got a message that can be improved,
useofbuiltinclosenotinfunctioncall
The text was updated successfully, but these errors were encountered:
odeke-em
changed the title
typechecker: improve error message
cmd/compile: improve error message to suggest that perhaps builtin is missing variable declaration
Apr 11, 2017
I don't think or missing variable declaration of <close> makes the error message easier to understand. The fact that close resolved to the builtin definition implies there weren't any shadowing declarations. If the user expected it to refer to something else, it seems obvious that it didn't.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?$ /home/mh-cbon/.gvm/gos/go1.8/bin/go version
go version go1.8 linux/amd64
$ /home/mh-cbon/.gvm/gos/go1.8/bin/go env
GOARCH="amd64"
GOBIN="/home/mh-cbon/gow/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mh-cbon/gow"
GORACE=""
GOROOT="/home/mh-cbon/.gvm/gos/go1.8"
GOTOOLDIR="/home/mh-cbon/.gvm/gos/go1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build249841147=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
wrote,
and ran
What did you expect to see?
That the type checker detect the use of a reserved keyword into
that call expression and assume it is either,
thus,
It happened because i copy pasted code and forgot to duplicate the close var declaration.
What did you see instead?
I got a message that can be improved,
The text was updated successfully, but these errors were encountered: