Commit 76e265b
committed
WIP: Vendor x/tools/go/importer, modify it 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.
While golang.org/x/tools/go/types/typeutil has been updated
to import go/types in https://golang.org/cl/18207, it appears
golang.org/x/tools/go/importer has not yet been updated in a similar way.
So if we import it 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 that
package and modify it to import go/types.
This can be undone as soon as the upstream package is modified to
import go/types itself.
I've asked about its status in the aforementioned CL. It seems unusual
that golang.org/x/tools/go/types/typeutil was updated but
golang.org/x/tools/go/importer was not, I suspect it was an unintended
omission.1 parent 6eda189 commit 76e265b
File tree
5 files changed
+1002
-2
lines changed- compiler
- third_party/importer
5 files changed
+1002
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments