mirror of
https://github.com/golang/go
synced 2024-11-23 09:10:08 -07:00
46ddf0873e
So they can be formatted more presicely, and make it easier in the transition to Unified IR. Updates #53058 Change-Id: I8b5a46db05a2e2822289458995b8653f0a3ffbbe Reviewed-on: https://go-review.googlesource.com/c/go/+/410594 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
19 lines
488 B
Go
19 lines
488 B
Go
// Copyright 2020 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 b
|
|
|
|
import "./a"
|
|
|
|
func g() {
|
|
h := a.E() // ERROR "inlining call to a.E" "T\(0\) does not escape"
|
|
h.M() // ERROR "devirtualizing h.M to a.T"
|
|
|
|
// BAD: T(0) could be stack allocated.
|
|
i := a.F(a.T(0)) // ERROR "inlining call to a.F" "a.T\(0\) escapes to heap"
|
|
|
|
// Testing that we do NOT devirtualize here:
|
|
i.M()
|
|
}
|