swiftlang/swift-syntax

swift format fails when using new `sending` keyword

fabianfett opened this issue · 4 comments

swift format fails when using new sending keyword.

Steps To Reproduce:

  1. Create a Foo.swift with following content and save:
struct Foo {
  var bar: String
}

func whatever(_ foo: sending Foo) {

}
  1. Run swift format Foo.swift on cli.

Results:

Observed:

Invocation fails: /Users/fabian/Developer/test.swift:5:30: error: unexpected code 'Foo' in parameter clause.

Expected:

swift format succeeds.

Notes:

Fails with Swift from Xcode-beta and swift-6.0-nightly on linux.

Synced to Apple’s issue tracker as rdar://135336930

This looks like a swift-syntax issue.

@ahoppen, since SE-0430 was accepted for Swift 6.0, should the sendingArgsAndResults experimental feature be removed and made unconditional?

Yes, that’s a swift-syntax issue. I’ll take it.

Should be fixed by: