cmd/compile: add regress test for #20682

Minimal reconstruction of reported failure case.

Manually verified that test fails with CL 45911 reverted.

Change-Id: Ia5d11500d91b46ba1eb5d841db3987edb9136c39
Reviewed-on: https://go-review.googlesource.com/45970
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2017-06-15 14:47:05 -07:00
parent 827be89a69
commit 6e549d2dfd
4 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,13 @@
// Copyright 2017 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
import "strings"
type T struct{}
func (T) M() {
strings.HasPrefix("", "")
}

View file

@ -0,0 +1,13 @@
// Copyright 2017 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 q
import "./p"
type T struct{}
func (T) M() interface{} {
return &p.T{}
}

View file

@ -0,0 +1,11 @@
// Copyright 2017 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 r
import "./q"
type T struct {
q.T
}

View file

@ -0,0 +1,7 @@
// compiledir
// Copyright 2017 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 ignored