File tree Expand file tree Collapse file tree 7 files changed +64
-44
lines changed Expand file tree Collapse file tree 7 files changed +64
-44
lines changed Original file line number Diff line number Diff line change @@ -18,42 +18,3 @@ type IConstraint interface {
1818
1919type I [T IConstraint ] struct {
2020}
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
66
77import (
88 "a"
9- "b"
109 "fmt"
1110)
1211
1312func main () {
1413 var x a.I [a.JsonRaw ]
15- var y b.InteractionRequest [a.JsonRaw ]
1614
17- fmt .Printf ("%v %v \n " , x , y )
15+ fmt .Printf ("%v\n " , x )
1816}
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 44
55package b
66
7- import "a"
7+ import (
8+ "./a"
9+ )
810
11+ // InteractionRequest is an incoming request Interaction
912type InteractionRequest [T a.InteractionDataConstraint ] struct {
1013 a.Interaction [T ]
1114}
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