-
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 Implementationgood first issueGood for newcomersGood for newcomerstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-11535 |
Radar | rdar://problem/56056152 |
Original Reporter | @theblixguy |
Type | Bug |
Status | Resolved |
Resolution | Done |
Environment
Swift 5.1
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, DiagnosticsQoI, StarterBug, TypeChecker |
Assignee | maveric (JIRA) |
Priority | Medium |
md5: 3440d3e720ac46459806c3e2a366f6c2
Issue Description:
The following code should trigger the ambiguous none warning, but doesn't:
enum Foo<T> {
case bar
static var none: Foo<Int> { .bar }
}
Expected:
let optionalFoo: Foo? = .none // warning: assuming you mean 'Optional<Foo>.none'; did you mean 'Foo<Int>.none' instead?
Actual
let optionalFoo: Foo? = .none // assigned Foo<Int>.none, instead of Optional.none
I am not sure why the solver is rejecting the Optional.none
solution and going for Foo<Int>.none
solution instead (maybe it's failing to bind T to a type?)
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