Source file test/fixedbugs/issue42284.dir/b.go

     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  	// BAD: T(0) could be stack allocated.
    14  	i := a.F(a.T(0)) // ERROR "inlining call to a.F" "a.T\(0\) escapes to heap"
    15  
    16  	// Testing that we do NOT devirtualize here:
    17  	i.M()
    18  }
    19  

View as plain text