| 1 |
// compile |
| 2 |
|
| 3 |
// Copyright 2021 The Go Authors. All rights reserved. |
| 4 |
// Use of this source code is governed by a BSD-style |
| 5 |
// license that can be found in the LICENSE file. |
| 6 |
|
| 7 |
package p |
| 8 |
|
| 9 |
func f[T any]() (f, g T) { return f, g } |
| 10 |
|
| 11 |
// Tests for generic function instantiation on the right hande side of multi-value |
| 12 |
// assignments. |
| 13 |
|
| 14 |
func g() { |
| 15 |
// Multi-value assignment within a function |
| 16 |
var _, _ = f[int]() |
| 17 |
} |
| 18 |
|
| 19 |
// Multi-value assignment outside a function. |
| 20 |
var _, _ = f[int]() |