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