Skip to content

Commit 6705856

Browse files
committed
---
yaml --- r: 319484 b: refs/heads/master-rebranch c: cc4da61 h: refs/heads/master
1 parent da43888 commit 6705856

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 0799c496e5e8d4dbe1459fe8a8dd7e803be64690
1460+
refs/heads/master-rebranch: cc4da61bd4721c72b36e9348be57b7b407307dac

branches/master-rebranch/lib/Sema/CodeSynthesis.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,9 @@ void swift::maybeAddAccessorsToStorage(AbstractStorageDecl *storage) {
20252025
return;
20262026

20272027
// Implicit properties don't get accessors.
2028-
if (storage->isImplicit())
2028+
if (storage->isImplicit() &&
2029+
!(isa<VarDecl>(storage) &&
2030+
cast<VarDecl>(storage)->getOriginalDelegatedProperty()))
20292031
return;
20302032

20312033
if (!dc->isTypeContext()) {

branches/master-rebranch/test/SILGen/property_delegates.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,25 @@ struct UseStatic {
253253
// CHECK: sil hidden [transparent] [ossa] @$s18property_delegates9UseStaticV12staticWibbleSaySiGvsZ
254254
@Lazy static var staticWibble = [1, 2, 3]
255255
}
256+
257+
extension WrapperWithInitialValue {
258+
func test() { }
259+
}
260+
261+
class ClassUsingWrapper {
262+
@WrapperWithInitialValue var x = 0
263+
}
264+
265+
// CHECK-LABEL: sil hidden [ossa] @$s18property_delegates21testClassUsingWrapper1cyAA0deF0C_tF : $@convention(thin) (@guaranteed ClassUsingWrapper) -> ()
266+
func testClassUsingWrapper(c: ClassUsingWrapper) {
267+
// CHECK: class_method [[GETTER:%.*]] : $ClassUsingWrapper, #ClassUsingWrapper.$x!getter.1
268+
c.$x.test()
269+
}
270+
271+
// CHECK-LABEL: sil_vtable ClassUsingWrapper {
272+
// CHECK: #ClassUsingWrapper.x!getter.1: (ClassUsingWrapper) -> () -> Int : @$s18property_delegates17ClassUsingWrapperC1xSivg // ClassUsingWrapper.x.getter
273+
// CHECK: #ClassUsingWrapper.x!setter.1: (ClassUsingWrapper) -> (Int) -> () : @$s18property_delegates17ClassUsingWrapperC1xSivs // ClassUsingWrapper.x.setter
274+
// CHECK: #ClassUsingWrapper.x!modify.1: (ClassUsingWrapper) -> () -> () : @$s18property_delegates17ClassUsingWrapperC1xSivM // ClassUsingWrapper.x.modify
275+
// CHECK: #ClassUsingWrapper.$x!getter.1: (ClassUsingWrapper) -> () -> WrapperWithInitialValue<Int> : @$s18property_delegates17ClassUsingWrapperC2$xAA0E16WithInitialValueVySiGvg // ClassUsingWrapper.$x.getter
276+
// CHECK: #ClassUsingWrapper.$x!setter.1: (ClassUsingWrapper) -> (WrapperWithInitialValue<Int>) -> () : @$s18property_delegates17ClassUsingWrapperC2$xAA0E16WithInitialValueVySiGvs // ClassUsingWrapper.$x.setter
277+
// CHECK: #ClassUsingWrapper.$x!modify.1: (ClassUsingWrapper) -> () -> () : @$s18property_delegates17ClassUsingWrapperC2$xAA0E16WithInitialValueVySiGvM // ClassUsingWrapper.$x.modify

0 commit comments

Comments
 (0)