Skip to content

Commit 4de2486

Browse files
committed
[SILGen] Emit property descriptors for protocol extensions
but not for protocol requirements.
1 parent 451737b commit 4de2486

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SIL/IR/SIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ bool AbstractStorageDecl::exportsPropertyDescriptor() const {
371371
if (isa<ProtocolDecl>(getDeclContext()))
372372
return false;
373373

374-
// Static properties in protocol extensions do not need
374+
// Static properties declared directly in protocol do not need
375375
// descriptors as existential Any.Type will not resolve to a value.
376-
if (isStatic() && getDeclContext()->getSelfProtocolDecl())
376+
if (isStatic() && isa<ProtocolDecl>(getDeclContext()))
377377
return false;
378378

379379
// FIXME: We should support properties and subscripts with '_read' accessors;

0 commit comments

Comments
 (0)