What version of Go are you using (go version)?
$ go version
go version devel go1.18-6e5dd0b Mon Sep 27 11:52:07 2021 +0000 linux/amd64
Does this issue reproduce with the latest release?
gotip
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/guilhem/.cache/go-build"
GOENV="/home/guilhem/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/guilhem/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/guilhem/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/guilhem/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/guilhem/sdk/gotip/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.18-6e5dd0b Mon Sep 27 11:52:07 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/guilhem/sources/go-workers/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3285140924=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Experimenting generics, I had to use a generics interface.
type Out[I any] interface {
SetOut(c chan I) error
}
type Runner[I, O any] struct {
...
}
func (r *Runner[I,O]) InFrom(w ...Out[I]) *Runner[I,O] {
...
}
func (r *Runner[I,O]) SetOut(c chan O) error {
...
}
https://github.com/guilhem/gorkers/blob/generics/workers.go#L18
running tests should trigger error
What did you see instead?
./workers_test.go:337:2: internal compiler error: NewMethodType with type parameters in signature FUNC-method(*struct {}) func(chan gorkers.I₁₄) error
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
gotip
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
Experimenting generics, I had to use a generics interface.
https://github.com/guilhem/gorkers/blob/generics/workers.go#L18
running tests should trigger error
What did you see instead?