| 1 |
package b |
| 2 |
|
| 3 |
import "a" |
| 4 |
import . "c" |
| 5 |
|
| 6 |
func f() { |
| 7 |
a.One() // want `cannot inline call to a.One because body refers to non-exported one` |
| 8 |
|
| 9 |
new(a.T).Two() // want `Call of \(a.T\).Two should be inlined` |
| 10 |
} |
| 11 |
|
| 12 |
//go:fix inline |
| 13 |
const in2 = a.Uno |
| 14 |
|
| 15 |
//go:fix inline |
| 16 |
const in3 = C // c.C, by dot import |
| 17 |
|
| 18 |
func g() { |
| 19 |
x := a.In1 // want `Constant a\.In1 should be inlined` |
| 20 |
|
| 21 |
a := 1 |
| 22 |
// Although the package identifier "a" is shadowed here, |
| 23 |
// a second import of "a" will be added with a new package identifer. |
| 24 |
x = in2 // want `Constant in2 should be inlined` |
| 25 |
|
| 26 |
x = in3 // want `Constant in3 should be inlined` |
| 27 |
|
| 28 |
_ = a |
| 29 |
_ = x |
| 30 |
} |
| 31 |
|
| 32 |
const d = a.D // nope: a.D refers to a constant in a package that is not visible here. |
| 33 |
|
| 34 |
var _ a.A // want `Type alias a\.A should be inlined` |
| 35 |
var _ a.B // want `Type alias a\.B should be inlined` |
| 36 |
var _ a.C // want `Type alias a\.C should be inlined` |
| 37 |
var _ R // want `Type alias R should be inlined` |
| 38 |
|
| 39 |
var _ a.G // nope: a.G refers to a type in a package that is not visible here |