@@ -72,7 +72,7 @@ class ValueDecl;
7272// / The witness for \c R.foo(x:) is \c X<U, V>.foo(x:), but the generic
7373// / functions that describe the generic requirement in \c R and the generic
7474// / method in \c X have very different signatures. To handle this case, the
75- // / \c Witness class produces a "synthetic" environment that pulls together
75+ // / \c Witness class produces a witness thunk signature that pulls together
7676// / all of the information needed to map from the requirement to the witness.
7777// / It is a generic environment that combines the constraints of the
7878// / requirement with the constraints from the context of the protocol
@@ -81,19 +81,19 @@ class ValueDecl;
8181// / environment are those of the context of the protocol conformance (\c U
8282// / and \c V, in the example above) and the innermost generic parameters are
8383// / those of the generic requirement (\c T, in the example above). The
84- // / \c Witness class contains this synthetic environment (both its generic
84+ // / \c Witness class contains this witness thunk signature (both its generic
8585// / signature and a generic environment providing archetypes), a substitution
8686// / map that allows one to map the interface types of the requirement into
87- // / the interface types of the synthetic domain, and the set of substitutions
88- // / required to use the witness from the synthetic domain (e.g., how one would
87+ // / the interface types of the witness thunk domain, and the set of substitutions
88+ // / required to use the witness from the witness thunk domain (e.g., how one would
8989// / call the witness from the witness thunk).
9090class Witness {
9191 struct StoredWitness {
9292 // / The witness declaration, along with the substitutions needed to use
93- // / the witness declaration from the synthetic environment .
93+ // / the witness declaration from the witness thunk signature .
9494 ConcreteDeclRef declRef;
95- GenericSignature syntheticSig ;
96- SubstitutionMap reqToSyntheticSigSubs ;
95+ GenericSignature witnessThunkSig ;
96+ SubstitutionMap reqToWitnessThunkSigSubs ;
9797 // / The derivative generic signature, when the requirement is a derivative
9898 // / function.
9999 GenericSignature derivativeGenSig;
@@ -124,7 +124,7 @@ class Witness {
124124
125125 // / Create a witness for the given requirement.
126126 // /
127- // / Deserialized witnesses do not have a synthetic environment .
127+ // / Deserialized witnesses do not have a witness thunk signature .
128128 static Witness forDeserialized (ValueDecl *decl,
129129 SubstitutionMap substitutions,
130130 Optional<ActorIsolation> enterIsolation) {
@@ -139,12 +139,12 @@ class Witness {
139139 // / \param decl The declaration for the witness.
140140 // /
141141 // / \param substitutions The substitutions required to use the witness from
142- // / the synthetic environment .
142+ // / the witness thunk signature .
143143 // /
144- // / \param syntheticSig The synthetic signature.
144+ // / \param witnessThunkSig The witness thunk signature.
145145 // /
146- // / \param reqToSyntheticSigSubs The mapping from the interface types of the
147- // / requirement into the interface types of the synthetic signature.
146+ // / \param reqToWitnessThunkSigSubs The mapping from the interface types of the
147+ // / requirement into the interface types of the witness thunk signature.
148148 // /
149149 // / \param derivativeGenSig The derivative generic signature, when the
150150 // / requirement is a derivative function.
@@ -153,13 +153,13 @@ class Witness {
153153 // / need to hop to before calling the witness.
154154 Witness (ValueDecl *decl,
155155 SubstitutionMap substitutions,
156- GenericSignature syntheticSig ,
157- SubstitutionMap reqToSyntheticSigSubs ,
156+ GenericSignature witnessThunkSig ,
157+ SubstitutionMap reqToWitnessThunkSigSubs ,
158158 GenericSignature derivativeGenSig,
159159 Optional<ActorIsolation> enterIsolation);
160160
161161 // / Retrieve the witness declaration reference, which includes the
162- // / substitutions needed to use the witness from the synthetic environment
162+ // / substitutions needed to use the witness from the witness thunk signature
163163 // / (if any).
164164 ConcreteDeclRef getDeclRef () const {
165165 if (auto stored = storage.dyn_cast <StoredWitness *>())
@@ -175,26 +175,23 @@ class Witness {
175175 explicit operator bool () const { return !storage.isNull (); }
176176
177177 // / Retrieve the substitutions required to use this witness from the
178- // / synthetic environment.
179- // /
180- // / The substitutions are substitutions for the witness, providing interface
181- // / types from the synthetic environment.
178+ // / witness thunk signature.
182179 SubstitutionMap getSubstitutions () const {
183180 return getDeclRef ().getSubstitutions ();
184181 }
185182
186- // / Retrieve the synthetic generic signature.
187- GenericSignature getSyntheticSignature () const {
183+ // / Retrieve the witness thunk generic signature.
184+ GenericSignature getWitnessThunkSignature () const {
188185 if (auto *storedWitness = storage.dyn_cast <StoredWitness *>())
189- return storedWitness->syntheticSig ;
186+ return storedWitness->witnessThunkSig ;
190187 return nullptr ;
191188 }
192189
193190 // / Retrieve the substitution map that maps the interface types of the
194- // / requirement to the interface types of the synthetic signature.
195- SubstitutionMap getRequirementToSyntheticSubs () const {
191+ // / requirement to the interface types of the witness thunk signature.
192+ SubstitutionMap getRequirementToWitnessThunkSubs () const {
196193 if (auto *storedWitness = storage.dyn_cast <StoredWitness *>())
197- return storedWitness->reqToSyntheticSigSubs ;
194+ return storedWitness->reqToWitnessThunkSigSubs ;
198195 return {};
199196 }
200197
0 commit comments