Skip to content
New issue

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

generic problem with interface #69486

Closed
chenjie199234 opened this issue Sep 16, 2024 · 1 comment
Closed

generic problem with interface #69486

chenjie199234 opened this issue Sep 16, 2024 · 1 comment

Comments

@chenjie199234
Copy link

Go version

1.23.1

Output of go env in your module/workspace:

set GO111MODULE=
set GOARCH=amd64
go: stripping unprintable or unescapable characters from %"GOBIN"%
set GOBIN=C:\Users\������\Desktop\Go\bin
go: stripping unprintable or unescapable characters from %"GOCACHE"%
set GOCACHE=C:\Users\������\Desktop\Go\cache
go: stripping unprintable or unescapable characters from %"GOENV"%
set GOENV=C:\Users\������\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
go: stripping unprintable or unescapable characters from %"GOMODCACHE"%
set GOMODCACHE=C:\Users\������\Desktop\Go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
go: stripping unprintable or unescapable characters from %"GOPATH"%
set GOPATH=C:\Users\������\Desktop\Go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=off
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.1
set GODEBUG=
set GOTELEMETRY=local
go: stripping unprintable or unescapable characters from %"GOTELEMETRYDIR"%
set GOTELEMETRYDIR=C:\Users\������\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
go: stripping unprintable or unescapable characters from %"GOMOD"%
set GOMOD=C:\Users\������\Desktop\Corelib\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
go: stripping unprintable or unescapable characters from %"GOGCCFLAGS"%

What did you do?

type I interface {
	P()
}
type S[data I] struct {
}

func (s *S[data]) test() {
	d := new(data)
	d.P() //this is forbidden,why?
}

What did you see happen?

type I interface {
	P()
}
type S[data I] struct {
}

func (s *S[data]) test() {
	d := new(data)
	d.P() //this is forbidden,why?
}

What did you expect to see?

the function can be called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants