1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // This file is meant as "dumping ground" for tests
6 // of not yet implemented features. It will grow and
7 // shrink over time.
8
9 package p
10
11 // When using []'s instead of ()'s for type parameters
12 // we don't need extra parentheses for some composite
13 // literal types.
14 type T1[P any] struct{}
15 type T2[P, Q any] struct{}
16
17 func _() {
18 _ = []T1[int]{} // ok if we use []'s
19 _ = [](T1[int]){}
20 _ = []T2[int, string]{} // ok if we use []'s
21 _ = [](T2[int, string]){}
22 }
23
View as plain text