github.com/goplus/gop@v1.2.6/testdata/typeparamscast/foo.go (about)

     1  package main
     2  
     3  type M = map[string]any
     4  
     5  type basetype interface {
     6  	string | int | bool | float64
     7  }
     8  
     9  type Var__0[T basetype] struct {
    10  	Val T
    11  }
    12  
    13  type Var__1[T map[string]any] struct {
    14  	Val T
    15  }
    16  
    17  func Gopx_Var_Cast__0[T basetype]() *Var__0[T] {
    18  	return new(Var__0[T])
    19  }
    20  
    21  func Gopx_Var_Cast__1[T map[string]any]() *Var__1[T] {
    22  	return new(Var__1[T])
    23  }