We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d50547d commit 31a7a18Copy full SHA for 31a7a18
src/reflect/value.go
@@ -1534,7 +1534,7 @@ func TypeAssert[T any](v Value) (T, bool) {
1534
if abi.TypeFor[T]() != v.typ() {
1535
// TypeAssert[T] should work the same way as v.Interface().(T), thus we need
1536
// to handle following case properly: TypeAssert[any](ValueOf(1)).
1537
- // 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()).
1538
if abi.TypeFor[T]().Kind() == abi.Interface {
1539
v, ok := packEface(v).(T)
1540
return v, ok
0 commit comments