What version of Go are you using (go version)?
$ go version
go version devel go1.18-66562692880 Thu Sep 30 01:32:54 2021 +0000 windows/amd64
Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\reus\AppData\Local\go-build
set GOENV=C:\Users\reus\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\reus\go\pkg\mod
set GONOPROXY=github.com/reusee/*
set GONOSUMDB=github.com/reusee/*
set GOOS=windows
set GOPATH=C:\Users\reus\go
set GOPRIVATE=github.com/reusee/*
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Users\reus\sdk\gotip
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\reus\sdk\gotip\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.18-66562692880 Thu Sep 30 01:32:54 2021 +0000
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
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\reus\AppData\Local\Temp\go-build2696702073=/tmp/go-build -gno-record-gcc-switches
GOROOT/bin/go version: go version devel go1.18-66562692880 Thu Sep 30 01:32:54 2021 +0000 windows/amd64
GOROOT/bin/go tool compile -V: compile version devel go1.18-66562692880 Thu Sep 30 01:32:54 2021 +0000
gdb --version: GNU gdb (GDB for MinGW-W64 x86_64, built by Brecht Sanders) 10.2
What did you do?
package main
func Foo[
T any,
P interface {
~func(T) P
},
](P) {
}
func main() {
type P func(int) P
Foo(P(nil))
}
What did you expect to see?
compile OK
What did you see instead?
.\a.go:5:2: type P = P does not match func(T) P
@griesemer The program used to be accepted by the compiler before 435718e
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
What did you expect to see?
compile OK
What did you see instead?
@griesemer The program used to be accepted by the compiler before 435718e