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

error: ambiguous reference to member '+'

    XMLWordPrintable

    Details

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

      Swift 3.0.2
      Xcode 8.2.1

      Description

      This code:

      let x: Double? = 1
      let sum = x! + x! + x!
      

      returns this error:

      error: ambiguous reference to member '+'
      let sum = x! + x! + x!
                   ^
      
      

      Workaround:

      let x: Double? = 1
      let sum = x! as Double + x! + x!
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jtbandes Jacob Bandes-Storch
              Reporter:
              Evilutiuoner Oleg Marchik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: