File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -499,3 +499,33 @@ type StructTag = reflectlite.StructTag
499499func TypeFor [T any ]() Type {
500500 return toType (reflectlite .TypeFor [T ]())
501501}
502+
503+ func SliceOf (t Type ) Type {
504+ return toType (reflectlite .SliceOf (toRawType (t )))
505+ }
506+
507+ func ArrayOf (n int , t Type ) Type {
508+ return toType (reflectlite .ArrayOf (n , toRawType (t )))
509+ }
510+
511+ func StructOf ([]StructField ) Type {
512+ return toType (reflectlite .StructOf ([]reflectlite.StructField {}))
513+ }
514+
515+ func MapOf (key , value Type ) Type {
516+ return toType (reflectlite .MapOf (toRawType (key ), toRawType (value )))
517+ }
518+
519+ func FuncOf (in , out []Type , variadic bool ) Type {
520+ rawIn := make ([]reflectlite.Type , len (in ))
521+ for i , t := range in {
522+ rawIn [i ] = toRawType (t )
523+ }
524+
525+ rawOut := make ([]reflectlite.Type , len (out ))
526+ for i , t := range out {
527+ rawOut [i ] = toRawType (t )
528+ }
529+
530+ return toType (reflectlite .FuncOf (rawIn , rawOut , variadic ))
531+ }
You can’t perform that action at this time.
0 commit comments