aboutsummaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/type.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/reflect/type.go b/src/reflect/type.go
index cec8662c01..fc6edb1e10 100644
--- a/src/reflect/type.go
+++ b/src/reflect/type.go
@@ -1314,7 +1314,8 @@ func TypeOf(i any) Type {
// TypeFor returns the [Type] that represents the type argument T.
func TypeFor[T any]() Type {
- return toType(abi.TypeFor[T]())
+ // toRType is safe to use here; type is never nil as T is statically known.
+ return toRType(abi.TypeFor[T]())
}
// rtypeOf directly extracts the *rtype of the provided value.