@@ -114,7 +114,42 @@ class TypeCheckRequest {
114
114
}
115
115
116
116
#include " swift/Sema/TypeCheckRequestPayloads.def"
117
-
117
+
118
+ TypeCheckRequest (const TypeCheckRequest &T) { *this = T; }
119
+
120
+ TypeCheckRequest& operator =(const TypeCheckRequest &T) {
121
+ TheKind = T.getKind ();
122
+ switch (getPayloadKind (TheKind)) {
123
+ case PayloadKind::Class:
124
+ Payload.Class = T.Payload .Class ;
125
+ break ;
126
+ case PayloadKind::Enum:
127
+ Payload.Enum = T.Payload .Enum ;
128
+ break ;
129
+ case PayloadKind::InheritedClauseEntry:
130
+ new (&Payload.InheritedClauseEntry )
131
+ std::pair<llvm::PointerUnion<TypeDecl *, ExtensionDecl *>, unsigned >();
132
+ Payload.InheritedClauseEntry = T.Payload .InheritedClauseEntry ;
133
+ break ;
134
+ case PayloadKind::Protocol:
135
+ Payload.Protocol = T.Payload .Protocol ;
136
+ break ;
137
+ case PayloadKind::DeclContextLookup:
138
+ new (&Payload.DeclContextLookup ) DeclContextLookupInfo ();
139
+ Payload.DeclContextLookup = T.Payload .DeclContextLookup ;
140
+ break ;
141
+ case PayloadKind::TypeResolution:
142
+ new (&Payload.InheritedClauseEntry )
143
+ std::tuple<TypeRepr *, DeclContext *, unsigned >();
144
+ Payload.TypeResolution = T.Payload .TypeResolution ;
145
+ break ;
146
+ case PayloadKind::TypeDeclResolution:
147
+ Payload.TypeDeclResolution = T.Payload .TypeDeclResolution ;
148
+ break ;
149
+ }
150
+ return *this ;
151
+ }
152
+
118
153
// / Determine the kind of type check request.
119
154
Kind getKind () const { return TheKind; }
120
155
0 commit comments