Uploaded image for project: 'Swift'
  1. Swift
  2. SR-8515

Compiler should show error for ambiguous enum cases with implicit casting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      Swift 4.1. Xcode 9.4.1 (9F2000)

      Description

      I've recently had trouble with UITableViewCellSelectionStyle. I have a function that accepts an optional UITableViewCellSelectionStyle. Optional has a "none" case, and "UITableViewCellSelectionStyle" too. This means that passing a .none is ambiguous (due to implicit casting to optional), as it could be interpreted as a nil value or a .some(.none). I think the best solution here would be to show an error if there is ambiguity.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              buscarini José Manuel Sánchez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: