Skip to content

Commit 67acddd

Browse files
authored
Merge pull request #77697 from eeckstein/no-silproperties-in-embedded
embedded: Don't emit SILProperties in embedded swift
2 parents 242fe5c + 4241a2c commit 67acddd

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,10 +1224,12 @@ void IRGenerator::emitGlobalTopLevel(
12241224
}
12251225
}
12261226

1227-
// Emit property descriptors.
1228-
for (auto &prop : PrimaryIGM->getSILModule().getPropertyList()) {
1229-
CurrentIGMPtr IGM = getGenModule(prop.getDecl()->getInnermostDeclContext());
1230-
IGM->emitSILProperty(&prop);
1227+
if (!SIL.getASTContext().LangOpts.hasFeature(Feature::Embedded)) {
1228+
// Emit property descriptors.
1229+
for (auto &prop : PrimaryIGM->getSILModule().getPropertyList()) {
1230+
CurrentIGMPtr IGM = getGenModule(prop.getDecl()->getInnermostDeclContext());
1231+
IGM->emitSILProperty(&prop);
1232+
}
12311233
}
12321234

12331235
// Emit differentiability witnesses.

test/embedded/keypath-crash.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,14 @@ public struct State<Wrapped> {
4242
}
4343
}
4444

45+
public struct S<T> {
46+
public private(set) subscript(x: Int) -> Int {
47+
get {
48+
return 27
49+
}
50+
mutating set {
51+
}
52+
}
53+
}
54+
4555
// CHECK: define {{.*}}@main(

0 commit comments

Comments
 (0)