go/gcimporter15: backport of https://golang.org/cl/23606/

Change-Id: I24a6a844e179dd1b69c90c5834d7998cb963c543
Reviewed-on: https://go-review.googlesource.com/24974
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/go/gcimporter15/gcimporter_test.go b/go/gcimporter15/gcimporter_test.go
index 4265516..16a1672 100644
--- a/go/gcimporter15/gcimporter_test.go
+++ b/go/gcimporter15/gcimporter_test.go
@@ -402,3 +402,28 @@
 		}
 	}
 }
+
+func TestIssue15920(t *testing.T) {
+	skipSpecialPlatforms(t)
+
+	// This package only handles gc export data.
+	if runtime.Compiler != "gc" {
+		t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler)
+		return
+	}
+
+	// On windows, we have to set the -D option for the compiler to avoid having a drive
+	// letter and an illegal ':' in the import path - just skip it (see also issue #3483).
+	if runtime.GOOS == "windows" {
+		t.Skip("avoid dealing with relative paths/drive letters on windows")
+	}
+
+	if f := compile(t, "testdata", "issue15920.go"); f != "" {
+		defer os.Remove(f)
+	}
+
+	imports := make(map[string]*types.Package)
+	if _, err := Import(imports, "./testdata/issue15920", "."); err != nil {
+		t.Fatal(err)
+	}
+}
diff --git a/go/gcimporter15/testdata/issue15920.go b/go/gcimporter15/testdata/issue15920.go
new file mode 100644
index 0000000..c70f7d8
--- /dev/null
+++ b/go/gcimporter15/testdata/issue15920.go
@@ -0,0 +1,11 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+// The underlying type of Error is the underlying type of error.
+// Make sure we can import this again without problems.
+type Error error
+
+func F() Error { return nil }