mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Emit ObjC thunks for initializers in extensions that fulfill @objc requirements.
Fixes <rdar://problem/17211135>. Swift SVN r19970
This commit is contained in:
@@ -1380,6 +1380,8 @@ public:
|
|||||||
SGM.emitObjCMethodThunk(method);
|
SGM.emitObjCMethodThunk(method);
|
||||||
else if (auto *prop = dyn_cast<VarDecl>(vd))
|
else if (auto *prop = dyn_cast<VarDecl>(vd))
|
||||||
SGM.emitObjCPropertyMethodThunks(prop);
|
SGM.emitObjCPropertyMethodThunks(prop);
|
||||||
|
else if (auto *ctor = dyn_cast<ConstructorDecl>(vd))
|
||||||
|
SGM.emitObjCConstructorThunk(ctor);
|
||||||
else
|
else
|
||||||
llvm_unreachable("unexpected conformance mapping");
|
llvm_unreachable("unexpected conformance mapping");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -192,3 +192,19 @@ func testInitializableExistential(im: Initializable.Type, i: Int) -> Initializab
|
|||||||
var i2 = im(int: i)
|
var i2 = im(int: i)
|
||||||
return i2
|
return i2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class InitializableConformer: Initializable {
|
||||||
|
required init(int: Int) {}
|
||||||
|
}
|
||||||
|
// CHECK-LABEL: sil @_TToFC14objc_protocols22InitializableConformercfMS0_FT3intSi_S0_
|
||||||
|
|
||||||
|
class InitializableConformerByExtension {
|
||||||
|
init() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension InitializableConformerByExtension: Initializable {
|
||||||
|
convenience init(int: Int) {
|
||||||
|
self.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// CHECK-LABEL: sil @_TToFC14objc_protocols33InitializableConformerByExtensioncfMS0_FT3intSi_S0_
|
||||||
|
|||||||
Reference in New Issue
Block a user