Source file test/fixedbugs/issue81165.go

     1  // build
     2  
     3  // Copyright 2026 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 someType struct{}
    10  type someTypeAlias = *someType
    11  
    12  //go:noinline
    13  func (tm someTypeAlias) FailedLink[T any](v T) {
    14  	println(v)
    15  }
    16  
    17  //go:noinline
    18  func (tm *someType) SuccessLink[T any](v T) {
    19  	println(v)
    20  }
    21  
    22  func main() {
    23  	var value someType
    24  	value.SuccessLink(42)
    25  	value.FailedLink(42)
    26  }
    27  

View as plain text