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

Wrong min() function is selected for call

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      Xcode Version 8.0 beta 6 (8S201h)

      Description

      see snippet below

      extension Collection where Self.Iterator.Element == Int
      {
          func foo() -> Int {
              return min(1,2) //Error: Argument passed to call that takes no arguments
          }
      
          func boo() -> Int? {
              return self.min()
          }
      }
      

      there is no local function min(x:y:) therefore I think compiler should automatically choose right Swift.min(x:y:) function, rather than trying to use local min() [no arguments].

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            krzyzanowskim Marcin Krzyzanowski
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: