File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1613,7 +1613,8 @@ void SILGenFunction::emitForeignToNativeThunk(SILDeclRef thunk) {
1613
1613
Type allocatorSelfType;
1614
1614
if (thunk.kind == SILDeclRef::Kind::Allocator) {
1615
1615
auto *selfDecl = fd->getImplicitSelfDecl ();
1616
- allocatorSelfType = F.mapTypeIntoContext (selfDecl->getInterfaceType ());
1616
+ allocatorSelfType = F.mapTypeIntoContext (
1617
+ fd->getDeclContext ()->getSelfInterfaceType ());
1617
1618
1618
1619
auto selfMetatype =
1619
1620
CanMetatypeType::get (allocatorSelfType->getCanonicalType ());
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ typedef long NSInteger;
39
39
- (Gizmo*) init OBJC_DESIGNATED_INITIALIZER;
40
40
- (Gizmo*) initWithBellsOn : (NSInteger )x OBJC_DESIGNATED_INITIALIZER;
41
41
- (instancetype ) initWithoutBells : (NSInteger )x ;
42
+ + (instancetype ) gizmoWithWhistles : (NSInteger )x ;
42
43
- (void ) fork NS_CONSUMES_SELF;
43
44
- (void ) enumerateSubGizmos : (void (^ _Nullable)(Gizmo*))f ;
44
45
+ (void ) consume : (NS_CONSUMED Gizmo*) gizmo ;
Original file line number Diff line number Diff line change 1
1
2
2
// RUN: %target-swift-emit-silgen -module-name objc_thunks -Xllvm -sil-full-demangle -Xllvm -sil-print-debuginfo -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -emit-verbose-sil -enable-sil-ownership | %FileCheck %s
3
+ // RUN: %target-swift-emit-silgen -module-name objc_thunks -Xllvm -sil-full-demangle -Xllvm -sil-print-debuginfo -sdk %S/Inputs -I %S/Inputs -enable-source-import %s -emit-verbose-sil -enable-sil-ownership -swift-version 5 | %FileCheck %s
3
4
4
5
// REQUIRES: objc_interop
5
6
@@ -592,3 +593,12 @@ func testObjCNoescapeThunk() {
592
593
// CHECK-NEXT: [[T4:%.*]] = tuple ()
593
594
// CHECK-NEXT: end_borrow [[T2]]
594
595
// CHECK-NEXT: return [[T4]]
596
+
597
+ // Call a convenience initializer
598
+ func buildGizmo1( ) -> Gizmo {
599
+ return Gizmo ( outBells: 10 )
600
+ }
601
+
602
+ func buildGizmo2( ) -> Gizmo {
603
+ return Gizmo ( whistles: 10 )
604
+ }
You can’t perform that action at this time.
0 commit comments