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
$ go1.18beta1 version
go version go1.18beta1 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go1.18beta1 env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\aksha\AppData\Local\go-build
set GOENV=C:\Users\aksha\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\aksha\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\aksha\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\aksha\sdk\go1.18beta1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\aksha\sdk\go1.18beta1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18beta1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\github.com\akshaybharambe14\go-generics-tests-bug\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\aksha\AppData\Local\Temp\go-build162005594=/tmp/go-build -gno-record-gcc-switches
What did you do?
go test fails to run tests with an error associated with compiling tests.
Quick refrence
Module structure
- a.go
- a_test.go
- b.go
- b_test.go
Running go1.18beta1 test fails for this module.
As this involves multiple files, for simplicity I am providing a reference to a repository. Following are the quick steps to reproduce the problem.
git clone https://github.com/akshaybharambe14/go-generics-tests-bug
cd go-generics-tests-bug
go1.18beta1 test
What did you expect to see?
PASS
ok github.com/akshaybharambe14/go-generics-tests-bug 0.197s
The text was updated successfully, but these errors were encountered:
akshaybharambe14
changed the title
[go1.18beata1] Bug while running package tests on generic code
[go1.18beta1] Bug while running package tests on generic code
Dec 26, 2021
ianlancetaylor
changed the title
[go1.18beta1] Bug while running package tests on generic code
cmd/compile: crash compiling code with local generic type
Dec 27, 2021
This is a dup of #50177 (can't currently declare a local generic type in a non-generic function). The potential fix listed on that issue fixes this issue. We haven't yet decided if we are going to support local generic types in non-generic functions for Go 1.18, but this issue can be duped with that issue. We will either make sure things work, or issue a compile-time error in this case.
Issue #47631 is a slightly different case - support for local types (generic or non-generic) in generic functions. We will definitely not support that case in Go 1.18 (i.e. we will stay with printing a compiler error)
Just to clarify (I wanted to double-check myself), the problem is the two conflicting local definitions of args[T] in find_test.go and delete_test.go. We are mixing up the instantiations of the two different args[T] types. This is fixed by https://go-review.googlesource.com/c/go/+/372654/ , if we decide to check it in.
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?
go test
fails to run tests with an error associated with compiling tests.Quick refrence
Module structure
Running
go1.18beta1 test
fails for this module.As this involves multiple files, for simplicity I am providing a reference to a repository. Following are the quick steps to reproduce the problem.
What did you expect to see?
What did you see instead?
Some observations
go1.18beta1 test find.go find_test.go
).From -
To -
The text was updated successfully, but these errors were encountered: