test/typeparam/issue54135.go | 10 +++++++--- diff --git a/test/typeparam/issue54135.go b/test/typeparam/issue54135.go index dffef60d0d7e2037cb25aeac55d192141ccba034..b489a514165d234d8c9ca7b98b32b0956ce4bbf5 100644 --- a/test/typeparam/issue54135.go +++ b/test/typeparam/issue54135.go @@ -1,4 +1,4 @@ -// compile +// run // Copyright 2022 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -19,8 +19,12 @@ Some() } func check[T comparable](p Bar[T]) { - _, _ = p.(any) - _, _ = p.(Baz) + if x, ok := p.(any); !ok || x != p { + panic("FAIL") + } + if _, ok := p.(Baz); ok { + panic("FAIL") + } } func main() {