File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ CastsTests.test("No overrelease of existential boxes in failed casts") {
43
43
}
44
44
}
45
45
}
46
-
46
+
47
47
let err : Error = ErrClass ( )
48
48
bar ( err)
49
49
}
@@ -70,6 +70,16 @@ CastsTests.test("Multi-level optionals can be casted") {
70
70
testFailure ( 42 , from: Int??? . self , to: String . self)
71
71
}
72
72
73
+ // Test for SR-9837: Optional<T>.none not casting to Optional<U>.none in generic context
74
+ CastsTests . test ( " Optional<T>.none can be casted to Optional<U>.none in generic context " ) {
75
+ func test< T> ( _ type: T . Type ) -> T ? {
76
+ return Any ? . none as? T
77
+ }
78
+
79
+ expectEqual ( type ( of: test ( Bool . self) ) , Bool ? . self)
80
+ expectEqual ( type ( of: test ( Bool ? . self) ) , Bool?? . self )
81
+ }
82
+
73
83
#if _runtime(_ObjC)
74
84
extension CFBitVector : P {
75
85
static func makeImmutable( from values: Array < UInt8 > ) -> CFBitVector {
You can’t perform that action at this time.
0 commit comments