[SR-14188] Extend "Literal value is already handled by previous pattern" to nil
literals
#56566
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Additional Detail from JIRA
md5: e4c7d0cd85360f93068188fda33a0878
Issue Description:
The following example prints `false`, because the `case nil, nil` is not matched by the passed value. This is because `case nil, nil` is treated as two separate patterns, equivalent to:
case nil: fallthrough case nil: ...
We have a check that diagnoses and warns about other duplicate literals, so we should probably extend that to `nil` literals as well!
The text was updated successfully, but these errors were encountered: