mirror of
https://github.com/golang/go
synced 2024-11-18 18:44:42 -07:00
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>
This commit is contained in:
parent
3f933d433a
commit
c550f66b0b
@ -402,3 +402,28 @@ func TestIssue15517(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
11
go/gcimporter15/testdata/issue15920.go
vendored
Normal file
11
go/gcimporter15/testdata/issue15920.go
vendored
Normal file
@ -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 }
|
Loading…
Reference in New Issue
Block a user