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

Misleading compiler errors

    XMLWordPrintable

    Details

      Description

       

       

      typealias Executable <Input> = (Input)->()
      let test: Executable<Void>? = { }
      

      The code above leads to the error:

      Cannot convert value of type '() -> ()' to specified type '((Void) -> ())?'

      Whereas this code compiles successfully:

      typealias Executable <Input> = (Input)->()
      let test: Executable<Void>? = { _ in }
      

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeremy.a.bannister Jeremy Bannister
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: