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

@autoclosure cannot be applied to tuples

    XMLWordPrintable

    Details

      Description

      given the tuple of

      (() -> A, () -> B)
      

      I would expect to be able to write:

      (@autoclosure () -> A, @autoclosure () -> B)
      

      However it claims this is only applicable to function parameters (which the tuple is a parameter to a function). Which in turn means that I need to explode the application of @autoclosure to all combinations of the tuple. In the two case it is fairly trivial but it could compose down from four functions down to one. Which would be considerably nicer for code-reuse

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              phausler Philippe Hausler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: