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

SwiftSyntax unrecognized `[self = foo]`

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: swift-format, SwiftSyntax
    • Labels:
      None
    • Environment:

      swift-syntax d518259
      macOS

      Description

      With this syntax:

      let foo = "hi"
      let bar = { [self = foo] in
          print(self)
      }
      

      swift-format errors with:

      % .build/debug/swift-format lint /tmp/foo.swift
      /tmp/foo.swift:2:11: error: file contains invalid or unrecognized Swift syntax.
      

      Based on some cursory look it seems that the issue here is from SwiftSyntax and not swift-format

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            keith Keith Smiley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: