Skip to content

Commit 16dc4f8

Browse files
authored
Merge pull request #2816 from DougGregor/specialize-complete-availability
Parse @_specialize with a complete availability clause
2 parents 34284eb + 4f13b67 commit 16dc4f8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Sources/SwiftParser/Attributes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ extension Parser {
730730
case (.availability, let handle)?:
731731
let label = self.eat(handle)
732732
let (unexpectedBeforeColon, colon) = self.expect(.colon)
733-
let availability = self.parseAvailabilitySpecList()
733+
let availability = self.parseAvailabilityArgumentSpecList()
734734
let (unexpectedBeforeSemi, semi) = self.expect(.semicolon)
735735
elements.append(
736736
.specializeAvailabilityArgument(

Tests/SwiftParserTest/AttributeTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ final class AttributeTests: ParserTestCase {
143143
)
144144
}
145145

146+
func testSpecializeWithAvailability() {
147+
assertParse(
148+
"""
149+
@_specialize(exported: true, kind: full, availability: iOS, introduced: 15.4; where T == Swift.Int)
150+
public func specializeWithAvailability<T>(_ t: T) { }
151+
"""
152+
)
153+
}
154+
146155
func testObjCAttribute() {
147156
assertParse(
148157
"""

0 commit comments

Comments
 (0)