golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.68k stars 17.49k forks source link

cmd/go2go: type checking failed in test mode #40998

Closed changkun closed 4 years ago

changkun commented 4 years ago

Example 1:

// a.go2
package p

type S [type T] struct {}

// errors_test.go2
package p

import "testing"

func TestFoo(t *testing.T) {}
$ go tool go2go test
type checking failed for p
errors_test.go2:1:1: inconsistent use of () or [] for type parameters

Workaround: Rename the test file name from errors_test.go2 to a_test.go2 will get a PASS.

Example 2:

// a.go2
package p

// a_test.go2
package p

import "testing"
type S [type T] struct {}
func TestFoo(t *testing.T) {}
$ go tool go2go test
type checking failed for p
a_test.go2:1:1: inconsistent use of () or [] for type parameters

Workaround: Delete a.go2 will get a PASS.

fzipp commented 4 years ago

Duplicate of #40806

cagedmantis commented 4 years ago

This seems to have reported in #40806. I'm going to close this issue. Please let me know if you think this was closed in error.