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

bad diagnostic for mismatched numeric types

    XMLWordPrintable

    Details

      Description

              let d = 0.2
              let x = self.view.frame.size.width * d
      

      The actual error here is obviously that `d` is a Double but `self.view.frame.size` is a CGFloat. However, the error message reads:

      Value of type '(CGRect) -> CGRect' has no member 'size'

      That is quite a fascinating diagnostic. Notice that this is not saying that CGRect has no `size`. It is talking about a function that takes a CGRect and returns a CGRect. I cannot imagine what function it has in mind!

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mattneub Matt Neuburg
              Reporter:
              mattneub Matt Neuburg
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: