]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: re-enable suppressed gcimporter tests
authorRobert Griesemer <gri@golang.org>
Thu, 16 May 2024 21:32:54 +0000 (14:32 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 17 May 2024 16:22:59 +0000 (16:22 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/go/internal/gcimporter/gcimporter_test.go
src/go/types/resolver.go

index 51b8dcd1551ec70e987ac18135129ea192687b24..07ab13518681cea6a9d6fb5039bc1bdcdfe46827 100644 (file)
@@ -7,7 +7,6 @@ package gcimporter_test
 import (
        "bytes"
        "fmt"
-       "internal/godebug"
        "internal/testenv"
        "os"
        "os/exec"
@@ -205,16 +204,6 @@ func TestImportTypeparamTests(t *testing.T) {
                                want := types.ObjectString(checkedObj, types.RelativeTo(checked))
                                want = sanitizeObjectString(want)
 
-                               // TODO(golang/go#66859): investigate and reenable these tests,
-                               // which fail with gotypesalias=1, soon to be the default.
-                               if godebug.New("gotypesalias").Value() != "0" {
-                                       symbol := name + " in " + filepath.Base(filename)
-                                       switch symbol {
-                                       case "Eint2 in struct.go", "A in issue50259.go":
-                                               t.Skipf("%s requires gotypesalias=1", symbol)
-                                       }
-                               }
-
                                if got != want {
                                        t.Errorf("imported %q as %q, want %q", name, got, want)
                                }
index 918e18de3e6446726988085b8fadc421f27bc061..e6e882e35f036746f554fa82dc37f5d8bdee5c08 100644 (file)
@@ -665,8 +665,23 @@ func (check *Checker) packageObjects() {
                }
        }
 
-       if check.conf._EnableAlias {
+       if false && check.conf._EnableAlias {
                // With Alias nodes we can process declarations in any order.
+               //
+               // TODO(adonovan): unfortunately, Alias nodes
+               // (GODEBUG=gotypesalias=1) don't entirely resolve
+               // problems with cycles. For example, in
+               // GOROOT/test/typeparam/issue50259.go,
+               //
+               //      type T[_ any] struct{}
+               //      type A T[B]
+               //      type B = T[A]
+               //
+               // TypeName A has Type Named during checking, but by
+               // the time the unified export data is written out,
+               // its Type is Invalid.
+               //
+               // Investigate and reenable this branch.
                for _, obj := range objList {
                        check.objDecl(obj, nil)
                }