-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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 Implementationgood first issueGood for newcomersGood for newcomerstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-11920 |
Radar | rdar://problem/57715257 |
Original Reporter | @CodaFi |
Type | Bug |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, DiagnosticsQoI, StarterBug, TypeChecker |
Assignee | None |
Priority | Medium |
md5: 6a0184667d6dc91a903498b162ead4ab
Issue Description:
protocol P { associatedtype T }
class C : P {}
func i<T: C>(_ x : T?) -> Bool {
// warning: checking a value with optional type 'T?' against dynamic type 'P' succeeds whenever the value is non-nil; did you mean to use '!= nil'?
return x is P
}
This warning's text makes no sense. `P` is not a dynamic protocol and may not be used in existential position. The wording of this diagnostic needs to be amended not to make reference to dynamism when a protocol may not be used in existential position.
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 Implementationgood first issueGood for newcomersGood for newcomerstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis