Skip to content

Commit a5539ec

Browse files
committed
Add release notes
1 parent 1a5a557 commit a5539ec

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Release Notes/601.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## New APIs
44

5+
- `GenericParameterSyntax` now has a new `specifier` property.
6+
- Description: With the introduction of value generics, generic parameters can now be optionally preceded by either a `let` or an `each`. The `specifier` property captures the token representing which one was parsed.
7+
- Pull Request: https://github.com/swiftlang/swift-syntax/pull/2785
8+
59
- `IntegerLiteralExprSyntax` and `FloatLiteralExprSyntax` now have a computed `representedLiteralValue` property.
610
- Description: Allows retrieving the represented literal value when valid.
711
- Issue: https://github.com/apple/swift-syntax/issues/405
@@ -27,6 +31,10 @@
2731

2832
## Deprecations
2933

34+
- `GenericParameterSyntax` deprecated `eachKeyword` in favor of `specifier`
35+
- Description: `specifier` is now used to grab either the `each` keyword for a generic parameter or the `let` keyword.
36+
- Pull request: https://github.com/swiftlang/swift-syntax/pull/2785
37+
3038
- `IncrementalEdit` deprecated in favor of `SourceEdit`
3139
- Description: `IncrementalEdit` is being dropped for `SourceEdit`. `SourceEdit` has deprecated compatibility layers to make it API-compatible with `IncrementalEdit`
3240
- Issue: https://github.com/apple/swift-syntax/issues/2532

Sources/SwiftParser/Declarations.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,9 @@ extension Parser {
431431
repeat {
432432
let attributes = self.parseAttributeList()
433433

434-
var specifier: Token? = nil
435-
436434
// Parse the 'each' keyword for a type parameter pack 'each T' or a
437435
// 'let' keyword for a value parameter 'let N: Int'.
438-
let specifier = self.consume(if: .keyword(.each), .keyword(.let))
436+
var specifier = self.consume(if: .keyword(.each), .keyword(.let))
439437

440438
let (unexpectedBetweenSpecifierAndName, name) = self.expectIdentifier(allowSelfOrCapitalSelfAsIdentifier: true)
441439
if attributes.isEmpty && specifier == nil && unexpectedBetweenSpecifierAndName == nil && name.isMissing

0 commit comments

Comments
 (0)