Skip to content

Commit 5c4af73

Browse files
committed
WIP: Vendor x/tools/go/importer, x/tools/go/types/typeutil, modify them to import go/types.
go/types defines some types just like golang.org/x/tools/go/types, but because they have different import paths, those types are not interchangeable. Not all packages have moved into Go standard library. Namely, golang.org/x/tools/go/importer and golang.org/x/tools/go/types/typeutil are still living in x/tools subrepo. They have not yet been updated to import go/types, so if we import them as is, we would have incompatible types defined in go/types and golang.org/x/tools/go/types. A temporary solution to have a working codebase is to vendor those 2 packages and modify them to import go/types. This can be undone as soon as the upstream packages are modified to import go/types themselves (should hopefully happen soon, e.g., see golang/tools@12c48ce for first related change).
1 parent 7b9282a commit 5c4af73

File tree

9 files changed

+1459
-3
lines changed

9 files changed

+1459
-3
lines changed

compiler/compiler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313

1414
"github.com/gopherjs/gopherjs/compiler/prelude"
15-
"golang.org/x/tools/go/importer"
15+
"github.com/gopherjs/gopherjs/third_party/importer"
1616
)
1717

1818
var sizes32 = &types.StdSizes{WordSize: 4, MaxAlign: 8}

compiler/package.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"strings"
1212

1313
"github.com/gopherjs/gopherjs/compiler/analysis"
14-
"golang.org/x/tools/go/importer"
15-
"golang.org/x/tools/go/types/typeutil"
14+
"github.com/gopherjs/gopherjs/third_party/importer"
15+
"github.com/gopherjs/gopherjs/third_party/typeutil"
1616
)
1717

1818
type pkgContext struct {

0 commit comments

Comments
 (0)