swiftlang/swift-syntax

New parser fails to parse `@convention` attribute with `cType` argument inside an array type

Closed this issue · 1 comments

Issue Kind

Parse of Valid Source Failed

Source Code

_ = [@convention(c, cType: "int (*)(int)") (Int32) -> Int32]()

Description

The issue is that the implementation of skipTypeAttribute doesn’t skip over the cType argument here. We should probably be able to just skipSingle to skip over all the arguments.

https://github.com/apple/swift-syntax/blob/89dd2bde9404950dede113b7898c97f6e2bc2fc4/Sources/SwiftParser/Lookahead.swift#L165-L173

Tracked in Apple’s issue tracker as rdar://122358055