Source file test/typeparam/gencrawler.dir/a.go

     1  // Copyright 2021 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 a
     6  
     7  var V val[int]
     8  
     9  type val[T any] struct {
    10  	valx T
    11  }
    12  
    13  func (v *val[T]) Print() {
    14  	v.print1()
    15  }
    16  
    17  func (v *val[T]) print1() {
    18  	println(v.valx)
    19  }
    20  
    21  func (v *val[T]) fnprint1() {
    22  	println(v.valx)
    23  }
    24  
    25  func FnPrint[T any](v *val[T]) {
    26  	v.fnprint1()
    27  }
    28  

View as plain text