Skip to content

Commit 46c63f3

Browse files
committed
go/gcimporter15: revert user-visible changes related to aliases
Reason: Decision to back out current alias implementation. For golang/go#16339 (comment). Change-Id: Id2a394d78a8661c767bcc05370b81f79d9bfb714 Reviewed-on: https://go-review.googlesource.com/32756 Run-TryBot: Robert Griesemer <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Chris Manghane <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 58ec10c commit 46c63f3

File tree

8 files changed

+24
-176
lines changed

8 files changed

+24
-176
lines changed

go/gcimporter15/bexport.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,20 @@ func (p *exporter) obj(obj types.Object) {
203203
p.paramList(sig.Params(), sig.Variadic())
204204
p.paramList(sig.Results(), false)
205205

206-
case *types_Alias:
207-
// make sure the original is exported before the alias
208-
// (if the alias declaration was invalid, orig will be nil)
209-
orig := original(obj)
210-
if orig != nil && !p.reexported[orig] {
211-
p.obj(orig)
212-
p.reexported[orig] = true
213-
}
214-
215-
p.tag(aliasTag)
216-
p.pos(obj)
217-
p.string(obj.Name())
218-
p.qualifiedName(orig)
206+
// Alias-related code. Keep for now.
207+
// case *types_Alias:
208+
// // make sure the original is exported before the alias
209+
// // (if the alias declaration was invalid, orig will be nil)
210+
// orig := original(obj)
211+
// if orig != nil && !p.reexported[orig] {
212+
// p.obj(orig)
213+
// p.reexported[orig] = true
214+
// }
215+
216+
// p.tag(aliasTag)
217+
// p.pos(obj)
218+
// p.string(obj.Name())
219+
// p.qualifiedName(orig)
219220

220221
default:
221222
log.Fatalf("gcimporter: unexpected object %v (%T)", obj, obj)

go/gcimporter15/bexport18_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// +build go1.8
5+
// Alias-related code. Keep for now.
6+
// +build ignore
67

78
package gcimporter_test
89

@@ -16,7 +17,7 @@ import (
1617
gcimporter "golang.org/x/tools/go/gcimporter15"
1718
)
1819

19-
func TestInvalidAlias(t *testing.T) {
20+
func disabledTestInvalidAlias(t *testing.T) {
2021
// parse and typecheck
2122
const src = "package p; func InvalidAlias => foo.f"
2223
fset1 := token.NewFileSet()

go/gcimporter15/bimport.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ func (p *importer) obj(tag int) {
288288
if pkg, name := p.qualifiedName(); pkg != nil {
289289
orig = pkg.Scope().Lookup(name)
290290
}
291-
p.declare(types_NewAlias(pos, p.pkgList[0], name, orig))
291+
// Alias-related code. Keep for now.
292+
_ = pos
293+
_ = name
294+
_ = orig
295+
// p.declare(types_NewAlias(pos, p.pkgList[0], name, orig))
292296

293297
default:
294298
errorf("unexpected object tag %d", tag)

go/gcimporter15/gcimporter_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func testDir(t *testing.T, dir string, endTime time.Time) (nimports int) {
130130
return
131131
}
132132

133+
const testfile = "exports.go"
134+
133135
func TestImportTestdata(t *testing.T) {
134136
// This package only handles gc export data.
135137
if runtime.Compiler != "gc" {

go/gcimporter15/newalias16.go

-28
This file was deleted.

go/gcimporter15/newalias18.go

-23
This file was deleted.

go/gcimporter15/testdata/exports18.go

-109
This file was deleted.

0 commit comments

Comments
 (0)