File tree Expand file tree Collapse file tree 4 files changed +31
-4
lines changed
stdlib/public/SDK/Foundation Expand file tree Collapse file tree 4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -498,10 +498,6 @@ extension Array : _ObjectiveCBridgeable {
498
498
_ source: NSArray ,
499
499
result: inout Array ?
500
500
) {
501
- _precondition (
502
- Swift . _isBridgedToObjectiveC ( Element . self) ,
503
- " array element type is not bridged to Objective-C " )
504
-
505
501
// If we have the appropriate native storage already, just adopt it.
506
502
if let native =
507
503
Array . _bridgeFromObjectiveCAdoptingNativeStorageOf ( source) {
Original file line number Diff line number Diff line change @@ -470,4 +470,16 @@ tests.test("testMutableArray") {
470
470
expectEqualSequence(aCopy, a)
471
471
}
472
472
473
+ tests.test("rdar://problem/27905230") {
474
+ let dict = RDar27905230.mutableDictionaryOfMutableLists()!
475
+ let arr = dict["list"]!
476
+ expectEqual(arr[0] as! NSNull, NSNull())
477
+ expectEqual(arr[1] as! String, "")
478
+ expectEqual(arr[2] as! Int, 1)
479
+ expectEqual(arr[3] as! Bool, true)
480
+ expectEqual((arr[4] as! NSValue).rangeValue.location, 0)
481
+ expectEqual((arr[4] as! NSValue).rangeValue.length, 1)
482
+ expectEqual(arr[5] as! Date, Date(timeIntervalSince1970: 0))
483
+ }
484
+
473
485
runAllTests()
Original file line number Diff line number Diff line change @@ -16,3 +16,7 @@ NSArray* idAsArray(id a);
16
16
17
17
void testSubclass (id thunks);
18
18
void testBridgeableValue (id thunks);
19
+
20
+ @interface RDar27905230 : NSObject
21
+ + (NSDictionary<NSString *, NSArray<id> *> *)mutableDictionaryOfMutableLists;
22
+ @end
Original file line number Diff line number Diff line change @@ -66,3 +66,18 @@ void testBridgeableValue(id thunks) {
66
66
[toSwiftArr addObject: [thunks createSubclass: 14 ]];
67
67
[thunks acceptBridgeableValueArray: toSwiftArr];
68
68
}
69
+
70
+ @implementation RDar27905230
71
+
72
+ + (NSDictionary <NSString *, NSArray<id> *> *)mutableDictionaryOfMutableLists {
73
+ NSMutableArray *arr = [NSMutableArray array ];
74
+ [arr addObject: [NSNull null ]];
75
+ [arr addObject: @" " ];
76
+ [arr addObject: @1 ];
77
+ [arr addObject: @YES ];
78
+ [arr addObject: [NSValue valueWithRange: NSMakeRange (0 , 1 )]];
79
+ [arr addObject: [NSDate dateWithTimeIntervalSince1970: 0 ]];
80
+ return [NSMutableDictionary dictionaryWithObject: arr forKey: @" list" ];
81
+ }
82
+
83
+ @end
You can’t perform that action at this time.
0 commit comments