Source file test/fixedbugs/issue63490.go

     1  // compile
     2  
     3  // Copyright 2023 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package main
     8  
     9  type ResourceFunc struct {
    10  	junk [8]int
    11  	base assignmentBaseResource
    12  }
    13  
    14  type SubscriptionAssignmentResource struct {
    15  	base assignmentBaseResource
    16  }
    17  
    18  type assignmentBaseResource struct{}
    19  
    20  //go:noinline
    21  func (a assignmentBaseResource) f(s string) ResourceFunc {
    22  	println(s)
    23  	return ResourceFunc{}
    24  }
    25  
    26  //go:noinline
    27  func (r SubscriptionAssignmentResource) Hi() ResourceFunc {
    28  	rf := r.base.f("Hello world")
    29  	rf.base = r.base
    30  	return rf
    31  }
    32  
    33  func main() {
    34  	var r SubscriptionAssignmentResource
    35  	r.Hi()
    36  }
    37  

View as plain text