[SR-14037] Conflicting Diagnostics for Covariant Self Appearing in Contravariant Position in Cast of Function Type #56428
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: 503768c75262eb22cbe579ec9a721575
Issue Description:
[Refiled on behalf of some contributor due to JIRA database reset]
This code is always safe:
Because covariant `Self` appears in contravariant position, the as! cast here will always succeed. We note as much if the parentheses are removed:
But we do not allow an unconditional cast
We should just allow this unconditionally.
The text was updated successfully, but these errors were encountered: