Merge pull request #23701 from DougGregor/property-delegates-as-custom-attributes

This commit is contained in:
swift-ci
2019-04-24 22:51:18 -07:00
committed by GitHub
94 changed files with 4396 additions and 189 deletions

View File

@@ -2100,9 +2100,12 @@ namespace {
// will avoid exponential typecheck behavior in the case of
// tuples, nested arrays, and dictionary literals.
//
// FIXME: This should be handled in the solver, not here.
//
// Otherwise, create a new type variable.
auto ty = Type();
if (!var->hasNonPatternBindingInit()) {
if (!var->hasNonPatternBindingInit() &&
!var->getAttachedPropertyDelegate()) {
if (auto boundExpr = locator.trySimplifyToExpr()) {
if (!boundExpr->isSemanticallyInOutExpr())
ty = CS.getType(boundExpr)->getRValueType();
@@ -2487,7 +2490,8 @@ namespace {
}
Type visitOpaqueValueExpr(OpaqueValueExpr *expr) {
llvm_unreachable("Already type checked");
assert(expr->isPlaceholder() && "Already type checked");
return expr->getType();
}
Type visitDefaultArgumentExpr(DefaultArgumentExpr *expr) {
@@ -3287,7 +3291,7 @@ namespace {
expr = value->second;
continue;
} else {
assert(eraseOpenExistentialsOnly &&
assert((eraseOpenExistentialsOnly || OVE->isPlaceholder()) &&
"Didn't see this OVE in a containing OpenExistentialExpr?");
// NOTE: In 'eraseOpenExistentialsOnly' mode, ASTWalker may walk
// into other kind of expressions holding OVE.