Skip to content

Commit 0c9ab7b

Browse files
authored
Merge pull request #9797 from jckarter/foreign-to-native-var-interface-type
SILGen: Use VarDecl::getInterfaceType instead of getType in emitForeignToNativeThunk.
2 parents 421684b + e824525 commit 0c9ab7b

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

lib/SILGen/SILGenBridging.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,8 @@ void SILGenFunction::emitForeignToNativeThunk(SILDeclRef thunk) {
12381238
// formally present in the constructor body.
12391239
Type allocatorSelfType;
12401240
if (thunk.kind == SILDeclRef::Kind::Allocator) {
1241-
allocatorSelfType = forwardedParameters[0]->getType(getASTContext())
1241+
allocatorSelfType = forwardedParameters[0]
1242+
->getInterfaceType(getASTContext())
12421243
->getLValueOrInOutObjectType();
12431244
forwardedParameters = forwardedParameters.slice(1);
12441245
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Foundation
2+
3+
open class Boom: NSObject {
4+
public override required init() {
5+
super.init()
6+
}
7+
}
8+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: rm -rf %t && mkdir -p %t
2+
// RUN: %target-swift-frontend -emit-module %S/Inputs/objc_required_designated_init_2.swift -module-name Booms -o %t/Booms.swiftmodule
3+
// RUN: %target-swift-frontend -I %t -emit-silgen -verify %s
4+
// REQUIRES: objc_interop
5+
6+
import Booms
7+
8+
class Baboom: Boom {
9+
required init() {
10+
super.init()
11+
}
12+
}
13+

0 commit comments

Comments
 (0)