@@ -2756,13 +2756,13 @@ ResolveTypeEraserTypeRequest::evaluate(Evaluator &evaluator,
2756
2756
ProtocolDecl *PD,
2757
2757
TypeEraserAttr *attr) const {
2758
2758
if (auto *typeEraserRepr = attr->getParsedTypeEraserTypeRepr ()) {
2759
- return TypeResolution::forContextual (PD, None,
2760
- // Unbound generics and placeholders
2761
- // are not allowed within this
2762
- // attribute.
2763
- /* unboundTyOpener */ nullptr ,
2764
- /* placeholderHandler */ nullptr )
2765
- . resolveType (typeEraserRepr );
2759
+ return TypeResolution::resolveContextualType (
2760
+ typeEraserRepr, PD, None,
2761
+ // Unbound generics and placeholders
2762
+ // are not allowed within this
2763
+ // attribute.
2764
+ /* unboundTyOpener */ nullptr ,
2765
+ /* placeholderHandler */ nullptr );
2766
2766
} else {
2767
2767
auto *LazyResolver = attr->Resolver ;
2768
2768
assert (LazyResolver && " type eraser was neither parsed nor deserialized?" );
@@ -2939,9 +2939,9 @@ void AttributeChecker::visitImplementsAttr(ImplementsAttr *attr) {
2939
2939
2940
2940
Type T = attr->getProtocolType ();
2941
2941
if (!T && attr->getProtocolTypeRepr ()) {
2942
- T = TypeResolution::forContextual (DC, None, /* unboundTyOpener */ nullptr ,
2943
- /* placeholderHandler */ nullptr )
2944
- . resolveType (attr-> getProtocolTypeRepr () );
2942
+ T = TypeResolution::resolveContextualType (attr-> getProtocolTypeRepr (), DC ,
2943
+ None, /* unboundTyOpener */ nullptr ,
2944
+ /* placeholderHandler */ nullptr );
2945
2945
}
2946
2946
2947
2947
// Definite error-types were already diagnosed in resolveType.
@@ -4741,11 +4741,10 @@ static bool typeCheckDerivativeAttr(ASTContext &Ctx, Decl *D,
4741
4741
if (auto *baseTypeRepr = attr->getBaseTypeRepr ()) {
4742
4742
const auto options =
4743
4743
TypeResolutionOptions (None) | TypeResolutionFlags::AllowModule;
4744
- baseType =
4745
- TypeResolution::forContextual (derivative->getDeclContext (), options,
4746
- /* unboundTyOpener*/ nullptr ,
4747
- /* placeholderHandler*/ nullptr )
4748
- .resolveType (baseTypeRepr);
4744
+ baseType = TypeResolution::resolveContextualType (
4745
+ baseTypeRepr, derivative->getDeclContext (), options,
4746
+ /* unboundTyOpener*/ nullptr ,
4747
+ /* placeholderHandler*/ nullptr );
4749
4748
}
4750
4749
if (baseType && baseType->hasError ())
4751
4750
return true ;
@@ -5334,10 +5333,10 @@ void AttributeChecker::visitTransposeAttr(TransposeAttr *attr) {
5334
5333
5335
5334
Type baseType;
5336
5335
if (attr->getBaseTypeRepr ()) {
5337
- baseType = TypeResolution::forContextual (transpose-> getDeclContext (), None,
5338
- /* unboundTyOpener */ nullptr ,
5339
- /* placeholderHandler */ nullptr )
5340
- . resolveType (attr-> getBaseTypeRepr () );
5336
+ baseType = TypeResolution::resolveContextualType (
5337
+ attr-> getBaseTypeRepr (), transpose-> getDeclContext (), None ,
5338
+ /* unboundTyOpener */ nullptr ,
5339
+ /* placeholderHandler */ nullptr );
5341
5340
}
5342
5341
auto lookupOptions =
5343
5342
(attr->getBaseTypeRepr () ? defaultMemberLookupOptions
0 commit comments