File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -684,18 +684,13 @@ namespace {
684
684
auto typedefBridgeability = getTypedefBridgeability (underlyingType);
685
685
686
686
// Figure out the typedef we should actually use.
687
- auto underlyingBridgeability =
688
- (Bridging == Bridgeability::Full
689
- ? typedefBridgeability : Bridgeability::None);
690
- SwiftTypeConverter innerConverter (Impl, AllowNSUIntegerAsInt,
691
- underlyingBridgeability);
687
+ SwiftTypeConverter innerConverter (Impl, AllowNSUIntegerAsInt, Bridging);
692
688
auto underlyingResult = innerConverter.Visit (underlyingType);
693
689
694
690
// If we used different bridgeability than this typedef normally
695
- // would because we're in a non-bridgeable context, and therefore
696
- // the underlying type is different from the mapping of the typedef,
697
- // use the underlying type.
698
- if (underlyingBridgeability != typedefBridgeability &&
691
+ // would, and therefore the underlying type is different from the
692
+ // mapping of the typedef, use the underlying type.
693
+ if (Bridging != typedefBridgeability &&
699
694
!underlyingResult.AbstractType ->isEqual (mappedType)) {
700
695
return underlyingResult;
701
696
}
Original file line number Diff line number Diff line change @@ -203,3 +203,9 @@ typedef SomeCell <NSCopying> *CopyableSomeCell;
203
203
@property (class , readonly ) InstancetypeAccessor *prop;
204
204
+ (instancetype )prop ;
205
205
@end
206
+
207
+ typedef NSArray <NSString *> *NSStringArray;
208
+
209
+ @interface BridgedTypedefs : NSObject
210
+ @property (readonly ,nonnull ) NSArray <NSStringArray> *arrayOfArrayOfStrings;
211
+ @end
Original file line number Diff line number Diff line change @@ -638,3 +638,8 @@ func testTypeAndValue() {
638
638
let _: ( ) -> testStruct = testStruct. init
639
639
let _: ( CInt ) -> testStruct = testStruct. init
640
640
}
641
+
642
+ // rdar://problem/34913507
643
+ func testBridgedTypedef( bt: BridgedTypedefs ) {
644
+ let _: Int = bt. arrayOfArrayOfStrings // expected-error{{'[[String]]'}}
645
+ }
You can’t perform that action at this time.
0 commit comments