@@ -1578,8 +1578,7 @@ static bool diagnoseAvailability(IdentTypeRepr *IdType,
1578
1578
}
1579
1579
1580
1580
// Hack to apply context-specific @escaping to an AST function type.
1581
- static Type applyNonEscapingFromContext (DeclContext *DC,
1582
- Type ty,
1581
+ static Type applyNonEscapingIfNecessary (Type ty,
1583
1582
TypeResolutionOptions options) {
1584
1583
// Remember whether this is a function parameter.
1585
1584
bool defaultNoEscape = options.is (TypeResolverContext::FunctionInput) &&
@@ -1890,7 +1889,7 @@ NeverNullType TypeResolver::resolveType(TypeRepr *repr,
1890
1889
auto result =
1891
1890
resolveASTFunctionType (cast<FunctionTypeRepr>(repr), options);
1892
1891
if (result && result->is <FunctionType>())
1893
- return applyNonEscapingFromContext ( getDeclContext (), result, options);
1892
+ return applyNonEscapingIfNecessary ( result, options);
1894
1893
return result;
1895
1894
}
1896
1895
return resolveSILFunctionType (cast<FunctionTypeRepr>(repr), options);
@@ -2343,7 +2342,7 @@ Type TypeResolver::resolveAttributedType(TypeAttributes &attrs,
2343
2342
attrs.clearAttribute (TAK_escaping);
2344
2343
} else {
2345
2344
// No attribute; set the isNoEscape bit if we're in parameter context.
2346
- ty = applyNonEscapingFromContext ( getDeclContext (), ty, options);
2345
+ ty = applyNonEscapingIfNecessary ( ty, options);
2347
2346
}
2348
2347
}
2349
2348
@@ -3254,7 +3253,7 @@ Type TypeResolver::resolveIdentifierType(IdentTypeRepr *IdType,
3254
3253
// Hack to apply context-specific @escaping to a typealias with an underlying
3255
3254
// function type.
3256
3255
if (result->is <FunctionType>())
3257
- result = applyNonEscapingFromContext ( getDeclContext (), result, options);
3256
+ result = applyNonEscapingIfNecessary ( result, options);
3258
3257
3259
3258
// Check the availability of the type.
3260
3259
0 commit comments