1
0
mirror of https://github.com/golang/go synced 2024-09-30 15:28:33 -06:00
go/test/typeparam/issue54135.go
Wayne Zuo 27038b70f8 cmd/compile: fix wrong dict pass condition for type assertions
Fixes #54135

Change-Id: I2b27af8124014b2699ea44bdc765e1fb8f6c8028
Reviewed-on: https://go-review.googlesource.com/c/go/+/420394
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-01 20:18:37 +00:00

29 lines
411 B
Go

// compile
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
type Foo struct{}
func (Foo) Blanker() {}
type Bar[T any] interface {
Blanker()
}
type Baz interface {
Some()
}
func check[T comparable](p Bar[T]) {
_, _ = p.(any)
_, _ = p.(Baz)
}
func main() {
check[int](Foo{})
}