We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
internal compiler error: expression has untyped type:
go version
$ go version go version go1.19.1 darwin/arm64
yes
go env
$ go env GO111MODULE="on" GOARCH="arm64" GOBIN="" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOOS="darwin" GOROOT="/usr/local/go" GOSUMDB="sum.golang.google.cn" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.19.1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" 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 arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jw/zvq1_tb50_93d6qdvcm_2jph0000gn/T/go-build1146727949=/tmp/go-build -gno-record-gcc-switches -fno-common"
func test[T string,R bool](a,b T ) R { return a>b } func main() { test[string,bool]("test1","test2") }
no compiler error
internal compiler error: expression has untyped type: . GT untyped bool tc(1) . . CALLFUNC Walked int tc(1) . . . NAME-runtime.cmpstring Class:PFUNC Offset:0 Used FUNC-func(string, string) int tc(1) . . CALLFUNC-Args . . . NAME-main.a esc(no) Class:PPARAM DictIndex:1 Offset:0 OnStack Used go.shape.string_0 tc(1) . . . NAME-main.b esc(no) Class:PPARAM DictIndex:1 Offset:0 OnStack Used go.shape.string_0 tc(1) . . LITERAL-0 int tc(1)
The text was updated successfully, but these errors were encountered:
master has fix this, may be need backport.
Sorry, something went wrong.
This works at tip, but fails with Go 1.18 and 1.19. I think we can close this.
cc @mdempsky @cuonglm for whether we could make it work for 1.19.
A workaround is to add explicit conversions, such as return R(bool(a > b))
return R(bool(a > b))
I think this is a dup of #54537, not a regression, though, so not qualified for backport
No branches or pull requests
internal compiler error: expression has untyped type:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
no compiler error
What did you see instead?
internal compiler error: expression has untyped type:
. GT untyped bool tc(1)
. . CALLFUNC Walked int tc(1)
. . . NAME-runtime.cmpstring Class:PFUNC Offset:0 Used FUNC-func(string, string) int tc(1)
. . CALLFUNC-Args
. . . NAME-main.a esc(no) Class:PPARAM DictIndex:1 Offset:0 OnStack Used go.shape.string_0 tc(1)
. . . NAME-main.b esc(no) Class:PPARAM DictIndex:1 Offset:0 OnStack Used go.shape.string_0 tc(1)
. . LITERAL-0 int tc(1)
The text was updated successfully, but these errors were encountered: