SILGen: Fix crash when emitting foreign-to-native thunk for allocating init in -swift-version 5

This comes up when we import a static factory method as a convenience init.
The thunk was using DynamicSelfType as the type of a basic block argument,
because that was the type of the 'self' parameter in -swift-version 5.

Fixes <rdar://problem/44242156>.
This commit is contained in:
Slava Pestov
2018-09-11 15:09:54 -07:00
parent 2cfea1f0ac
commit c69d43e87d
3 changed files with 13 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ typedef long NSInteger;
- (Gizmo*) init OBJC_DESIGNATED_INITIALIZER;
- (Gizmo*) initWithBellsOn:(NSInteger)x OBJC_DESIGNATED_INITIALIZER;
- (instancetype) initWithoutBells:(NSInteger)x;
+ (instancetype) gizmoWithWhistles:(NSInteger)x;
- (void) fork NS_CONSUMES_SELF;
- (void) enumerateSubGizmos: (void (^ _Nullable)(Gizmo*))f;
+ (void) consume: (NS_CONSUMED Gizmo*) gizmo;