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

Function with tuple parameter is printed incorrectly

    XMLWordPrintable

    Details

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

      Xcode 9.4, Xcode 10 betas and recent dev snapshot

      Description

      func g(_ x: Int, _ y: Int) {}
      func h(_ tuple: (Int, Int)) {}
      
      print("Type of g:", type(of: g)) // (Int, Int) -> ()
      print("Type of h:", type(of: h)) // (Int, Int) -> ()
      // Note that the type of h is printed incorrectly, it
      // should be: ((Int, Int)) -> ()
      
      // The types are different however:
      print("Type of g == Type of h:", type(of: g) == type(of: h)) // false
      

        Attachments

          Activity

            People

            Assignee:
            slavapestov Slava Pestov
            Reporter:
            jens Jens Persson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: