| 1 |
// Copyright 2020 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package b |
| 6 |
|
| 7 |
import "./a" |
| 8 |
|
| 9 |
func g() { |
| 10 |
h := a.E() // ERROR "inlining call to a.E" "T\(0\) does not escape" |
| 11 |
h.M() // ERROR "devirtualizing h.M to a.T" "inlining call to a.T.M" |
| 12 |
|
| 13 |
i := a.F(a.T(0)) // ERROR "inlining call to a.F" "a.T\(0\) does not escape" |
| 14 |
|
| 15 |
// It is fine that we devirtualize here, as we add an additional nilcheck. |
| 16 |
i.M() // ERROR "devirtualizing i.M to a.T" "inlining call to a.T.M" |
| 17 |
} |