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 tool go2go run *.go2# command-line-arguments
./test.go2:4: cannot use instantiate୦୦Wrap୦struct୮4୮5() (type instantiate୦୦Func୦struct୮4୮5) as type instantiate୦୦Func୦struct୮4୮5 in argument to Do().Func
./second.go2:23: instantiate୦୦Func୦struct୮4୮5 redeclared in this block
previous declaration at ./second.go2:15
/home/deedles/devel/build/go/bin/go [run second.go test.go] failed: exit status 2
Moving the definition of Do() into the first file fixes it. Using a named empty struct type, such as type None struct {}, doesn't fix it.
The text was updated successfully, but these errors were encountered:
DeedleFake
changed the title
cmd/go2go: returning a generic anonymous function type from a function declared in a second file with an empty struct parameter incorrectly claims a redeclaration
cmd/go2go: incorrect redeclaration claim in very specific circumstance with two files
Jun 21, 2020
DeedleFake
changed the title
cmd/go2go: incorrect redeclaration claim in very specific circumstance with two files
cmd/go2go: incorrect redeclaration error in very specific circumstance with multiple files
Jun 21, 2020
This doesn't work in the playground because it requires a second file.
File one:
File two:
Output:
Moving the definition of
Do()
into the first file fixes it. Using a named empty struct type, such astype None struct {}
, doesn't fix it.The text was updated successfully, but these errors were encountered: