File tree 2 files changed +12
-5
lines changed
cmd/stringer/testdata/typeparams
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,20 @@ package main
10
10
11
11
import "fmt"
12
12
13
- type Other [T interface { ~ int | ~ uint }] T // Imagine this is in another package.
13
+ // For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
14
+ // type Other[T interface{ ~int | ~uint }] T // Imagine this is in another package.
15
+ type Other int
14
16
15
17
const (
16
- alpha Other [int ] = iota
18
+ // alpha Other[int] = iota
19
+ alpha Other = iota
17
20
beta
18
21
gamma
19
22
delta
20
23
)
21
24
22
- type Conv2 Other [int ]
25
+ // type Conv2 Other[int]
26
+ type Conv2 Other
23
27
24
28
const (
25
29
Alpha = Conv2 (alpha )
Original file line number Diff line number Diff line change @@ -11,9 +11,12 @@ package main
11
11
12
12
import "fmt"
13
13
14
- type Likeint [T interface { ~ int | ~ uint8 }] T
14
+ // For now, a lone type parameter is not permitted as RHS in a type declaration (issue #45639).
15
+ // type Likeint[T interface{ ~int | ~uint8 }] T
16
+ type Likeint int
15
17
16
- type Prime2 Likeint [int ]
18
+ // type Prime2 Likeint[int]
19
+ type Prime2 Likeint
17
20
18
21
const (
19
22
p2 Prime2 = 2
You can’t perform that action at this time.
0 commit comments