-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationexpressionsFeature: expressionsFeature: expressionsfor-in loopsFeature: for-in loopsFeature: for-in loopsliteralsFeature → expressions: Literals such as an integer or string literalFeature → expressions: Literals such as an integer or string literalstatementsFeature: statementsFeature: statementstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistype inferenceFeature: type inferenceFeature: type inference
Description
Consider the following code:
class Base { }
class Derived : Base { }
let arr: [Base]
for case _ as [Derived] in [arr] {} // warning: heterogeneous collection literal could only be inferred to '[[Base]]'; add explicit type annotation if this is intentionalThis diagnostics should not be emitted.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationexpressionsFeature: expressionsFeature: expressionsfor-in loopsFeature: for-in loopsFeature: for-in loopsliteralsFeature → expressions: Literals such as an integer or string literalFeature → expressions: Literals such as an integer or string literalstatementsFeature: statementsFeature: statementstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistype inferenceFeature: type inferenceFeature: type inference