Skip to content

Commit f73dd81

Browse files
griesemergopherbot
authored andcommitted
go/types: re-enable suppressed gcimporter tests
Port CL 577616 from types2 to go/types allows us to re-enable these tests. Fixes #66859. Fixes #67436. Updates #50259. Updates #65294. Change-Id: I573e51cf16546ac1c115beac5322b51dd998c881 Reviewed-on: https://go-review.googlesource.com/c/go/+/586236 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Robert Griesemer <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent a61729b commit f73dd81

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/go/internal/gcimporter/gcimporter_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package gcimporter_test
77
import (
88
"bytes"
99
"fmt"
10-
"internal/godebug"
1110
"internal/testenv"
1211
"os"
1312
"os/exec"
@@ -205,16 +204,6 @@ func TestImportTypeparamTests(t *testing.T) {
205204
want := types.ObjectString(checkedObj, types.RelativeTo(checked))
206205
want = sanitizeObjectString(want)
207206

208-
// TODO(golang/go#66859): investigate and reenable these tests,
209-
// which fail with gotypesalias=1, soon to be the default.
210-
if godebug.New("gotypesalias").Value() != "0" {
211-
symbol := name + " in " + filepath.Base(filename)
212-
switch symbol {
213-
case "Eint2 in struct.go", "A in issue50259.go":
214-
t.Skipf("%s requires gotypesalias=1", symbol)
215-
}
216-
}
217-
218207
if got != want {
219208
t.Errorf("imported %q as %q, want %q", name, got, want)
220209
}

src/go/types/resolver.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,23 @@ func (check *Checker) packageObjects() {
665665
}
666666
}
667667

668-
if check.conf._EnableAlias {
668+
if false && check.conf._EnableAlias {
669669
// With Alias nodes we can process declarations in any order.
670+
//
671+
// TODO(adonovan): unfortunately, Alias nodes
672+
// (GODEBUG=gotypesalias=1) don't entirely resolve
673+
// problems with cycles. For example, in
674+
// GOROOT/test/typeparam/issue50259.go,
675+
//
676+
// type T[_ any] struct{}
677+
// type A T[B]
678+
// type B = T[A]
679+
//
680+
// TypeName A has Type Named during checking, but by
681+
// the time the unified export data is written out,
682+
// its Type is Invalid.
683+
//
684+
// Investigate and reenable this branch.
670685
for _, obj := range objList {
671686
check.objDecl(obj, nil)
672687
}

0 commit comments

Comments
 (0)