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

Casting CGFloat to NSNumber in map closure using $0 broken in DEVELOPMENT-SNAPSHOT-2016-11-29-a

    XMLWordPrintable

    Details

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

      Swift 3 DEVELOPMENT-SNAPSHOT-2016-11-29-a, macOS Sierra

      Description

      I recently tried out Swift 3 DEVELOPMENT-SNAPSHOT-2016-11-29-a, and the following breaks on that snapshot but works fine in Xcode 8.1 and Xcode 8.2 beta 2:

      import Foundation
      
      let f: CGFloat = 4.0
      let _ = [f].map { $0 as NSNumber }
      

      In this snapshot, I get the following error:

      test.swift:4:17: error: cannot convert value of type '(CGFloat) -> NSNumber' to expected argument type '(CGFloat) -> _'

        Attachments

          Activity

            People

            Assignee:
            DougGregor Doug Gregor
            Reporter:
            benasher44 Ben A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: