Skip to content

Commit a3701cb

Browse files
committed
[SE-0258] Swift interface files have explicit get/set for wrapped properties
1 parent 1e2ef1b commit a3701cb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/TypeCheckPropertyDelegate.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ AttachedPropertyDelegateRequest::evaluate(Evaluator &evaluator,
265265

266266
// If the declaration came from a module file, we've already done all of
267267
// the semantic checking required.
268-
if (!dc->getParentSourceFile())
268+
auto sourceFile = dc->getParentSourceFile();
269+
if (!sourceFile)
269270
return mutableAttr;
270271

271272
// Check various restrictions on which properties can have delegates
@@ -344,7 +345,7 @@ AttachedPropertyDelegateRequest::evaluate(Evaluator &evaluator,
344345
}
345346

346347
// Properties with delegates must not declare a getter or setter.
347-
if (!var->hasStorage()) {
348+
if (!var->hasStorage() && sourceFile->Kind != SourceFileKind::Interface) {
348349
ctx.Diags.diagnose(attr->getLocation(), diag::property_delegate_computed);
349350
return nullptr;
350351
}

0 commit comments

Comments
 (0)