File tree 7 files changed +64
-44
lines changed 7 files changed +64
-44
lines changed Original file line number Diff line number Diff line change @@ -18,42 +18,3 @@ type IConstraint interface {
18
18
19
19
type I [T IConstraint ] struct {
20
20
}
21
-
22
- // The following types form an even more complex recursion (through two type
23
- // constraints), and model the actual types in the issue (#51219) more closely.
24
- // However, they don't reveal any new issue. But it seems useful to leave this
25
- // complex set of types in a test in case it might be broken by future changes.
26
-
27
- type Message struct {
28
- Interaction * Interaction [JsonRaw ] `json:"interaction,omitempty"`
29
- }
30
-
31
- type ResolvedDataConstraint interface {
32
- User | Message
33
- }
34
-
35
- type Snowflake uint64
36
-
37
- type ResolvedData [T ResolvedDataConstraint ] map [Snowflake ]T
38
-
39
- type User struct {
40
- }
41
-
42
- type Resolved struct {
43
- Users ResolvedData [User ] `json:"users,omitempty"`
44
- }
45
-
46
- type resolvedInteractionWithOptions struct {
47
- Resolved Resolved `json:"resolved,omitempty"`
48
- }
49
-
50
- type UserCommandInteractionData struct {
51
- resolvedInteractionWithOptions
52
- }
53
-
54
- type InteractionDataConstraint interface {
55
- JsonRaw | UserCommandInteractionData
56
- }
57
-
58
- type Interaction [DataT InteractionDataConstraint ] struct {
59
- }
Original file line number Diff line number Diff line change @@ -6,13 +6,11 @@ package main
6
6
7
7
import (
8
8
"a"
9
- "b"
10
9
"fmt"
11
10
)
12
11
13
12
func main () {
14
13
var x a.I [a.JsonRaw ]
15
- var y b.InteractionRequest [a.JsonRaw ]
16
14
17
- fmt .Printf ("%v %v \n " , x , y )
15
+ fmt .Printf ("%v\n " , x )
18
16
}
Original file line number Diff line number Diff line change 1
- {} {{}}
1
+ {}
Original file line number Diff line number Diff line change
1
+ // Copyright 2022 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
+ package a
6
+
7
+ type Interaction [DataT InteractionDataConstraint ] struct {
8
+ }
9
+
10
+ type InteractionDataConstraint interface {
11
+ []byte |
12
+ UserCommandInteractionData
13
+ }
14
+
15
+ type UserCommandInteractionData struct {
16
+ resolvedInteractionWithOptions
17
+ }
18
+
19
+ type resolvedInteractionWithOptions struct {
20
+ Resolved Resolved `json:"resolved,omitempty"`
21
+ }
22
+
23
+ type Resolved struct {
24
+ Users ResolvedData [User ] `json:"users,omitempty"`
25
+ }
26
+
27
+ type ResolvedData [T ResolvedDataConstraint ] map [uint64 ]T
28
+
29
+ type ResolvedDataConstraint interface {
30
+ User | Message
31
+ }
32
+
33
+ type User struct {}
34
+
35
+ type Message struct {
36
+ Interaction * Interaction [[]byte ] `json:"interaction,omitempty"`
37
+ }
Original file line number Diff line number Diff line change 4
4
5
5
package b
6
6
7
- import "a"
7
+ import (
8
+ "./a"
9
+ )
8
10
11
+ // InteractionRequest is an incoming request Interaction
9
12
type InteractionRequest [T a.InteractionDataConstraint ] struct {
10
13
a.Interaction [T ]
11
14
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2022 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
+ package p
6
+
7
+ import (
8
+ "./b"
9
+ )
10
+
11
+ // ResponseWriterMock mocks corde's ResponseWriter interface
12
+ type ResponseWriterMock struct {
13
+ x b.InteractionRequest [[]byte ]
14
+ }
Original file line number Diff line number Diff line change
1
+ // compiledir -G=3
2
+
3
+ // Copyright 2022 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 ignored
You can’t perform that action at this time.
0 commit comments