We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb46a00 commit e452d77Copy full SHA for e452d77
src/reflect/value.go
@@ -1531,7 +1531,7 @@ func TypeAssert[T any](v Value) (T, bool) {
1531
if abi.TypeFor[T]() != v.typ() {
1532
// TypeAssert[T] should work the same way as v.Interface().(T), thus we need
1533
// to handle following case properly: TypeAssert[any](ValueOf(1)).
1534
- // Note that we will not hit here is such case: TypeAssert[any](ValueOf(any(1))).
+ // Note that we will not hit here is such case: TypeAssert[any](ValueOf(new(any)).Elem()).
1535
if abi.TypeFor[T]().Kind() == abi.Interface {
1536
v, ok := packEface(v).(T)
1537
return v, ok
0 commit comments