diff options
| author | Wayne Zuo <wdvxdr@golangcn.org> | 2022-06-07 09:12:21 +0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2022-06-22 22:14:02 +0000 |
| commit | ff17b7d0d42af12ca1ad766a135d9951029027ea (patch) | |
| tree | 12c2c4b27e9107eff5ebfaf2d7d002b01740a813 /test/typeparam | |
| parent | 2a3b467d5f8de04a3493b7ab8cd886e109bd9283 (diff) | |
| download | go-ff17b7d0d42af12ca1ad766a135d9951029027ea.tar.xz | |
cmd/compile: don't use dictionary convert to shaped empty interface
Fixes: #53254
Change-Id: I3153d6ebb9f25957b09363f45c5cd4651ee84c2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/410655
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'test/typeparam')
| -rw-r--r-- | test/typeparam/issue53254.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/typeparam/issue53254.go b/test/typeparam/issue53254.go new file mode 100644 index 0000000000..afc0f18471 --- /dev/null +++ b/test/typeparam/issue53254.go @@ -0,0 +1,19 @@ +// 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 Interface[T any] interface { +} + +func F[T any]() Interface[T] { + var i int + return i +} + +func main() { + F[int]() +} |
