Commits
Joe Groff committed a52c6ba2974
Sema: Don't warn on casts that change an ObjC generic's parameters.
Some ObjC generic APIs rely on covariance, and until we devise a systematic solution for SR-1522, you need to force-cast to get the types to line up in cases like this:
func foo(x: GenericClass<NSMutableString>) {
let x2 = x as! GenericClass<NSString>
takeGenericClassOfNSString(x2)
}
We currently raise a "cast will never succeed" warning, which is wrong because the dynamic cast can't even check the generic parameters. Suppress this warning. Fixes rdar://problem/26398265.