aboutsummaryrefslogtreecommitdiff
path: root/src/reflect/all_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflect/all_test.go')
-rw-r--r--src/reflect/all_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go
index fb1a29d060..cd3e306a57 100644
--- a/src/reflect/all_test.go
+++ b/src/reflect/all_test.go
@@ -8719,6 +8719,11 @@ func TestTypeAssert(t *testing.T) {
testTypeAssert(t, any(int(1)), int(1), true)
testTypeAssert(t, any(int(1)), byte(0), false)
testTypeAssert(t, fmt.Stringer(vv), vv, true)
+
+ testTypeAssert(t, any(nil), any(nil), false)
+ testTypeAssert(t, any(nil), error(nil), false)
+ testTypeAssert(t, error(nil), any(nil), false)
+ testTypeAssert(t, error(nil), error(nil), false)
}
func testTypeAssert[T comparable, V any](t *testing.T, val V, wantVal T, wantOk bool) {