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
go version devel +2dc2987ac87 Tue Jun 23 23:41:16 2020 +0000 linux/amd64
bug/a.go:
package main
import "bug/lib"
type Bug(type T) interface {
Get() T
}
func MakeCollision(type T)(bug Bug(T)) {
}
func main() {
impl := lib.NewBug(int)(1)
MakeCollision(int)(impl)
}
bug/lib/b.go:
package lib
type Bug(type T) struct {
x T
}
func NewBug(type T)(x T) Bug(T) {
return Bug(T){x: x}
}
func (bug Bug(T)) Get() T {
return bug.x
}
current result:
> go tool go2go run a.go2
# command-line-arguments
./a.go2:5: invalid composite literal type instantiate୦୦Bug୦int
./a.go2:10: instantiate୦୦Bug୦int redeclared in this block
previous declaration at ./a.go2:11
/usr/lib/go/bin/go [run a.go] failed: exit status 2
The text was updated successfully, but these errors were encountered:
If an instantiated function from a different package uses a plain
identifier to instantiate a generic type or function, include the
package name in the generated identifier.
Fixes#39834
Change-Id: I4c786bac8972475e180cb41178520439343a36ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/239706
Reviewed-by: Ian Lance Taylor <iant@golang.org>
bug/a.go:
bug/lib/b.go:
current result:
The text was updated successfully, but these errors were encountered: