Skip to content

Commit efa33ac

Browse files
committed
Add release notes and format
1 parent 244fcd7 commit efa33ac

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

Release Notes/603.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Swift Syntax 603 Release Notes
2+
3+
## New APIs
4+
5+
- `GenericParameterSyntax` now has a new `initializer` property.
6+
- Description: Generic parameters can now optionally be passed a default type. The `initializer` is a `TypeInitializerSyntax` that captures both the `=` and the parsed `TypeSyntax`.
7+
- Pull Request: https://github.com/swiftlang/swift-syntax/pull/3152
8+
9+
## API Behavior Changes
10+
11+
## Deprecations
12+
13+
## API-Incompatible Changes
14+
15+
## Template
16+
17+
- *Affected API or two word description*
18+
- Description: *A 1-2 sentence description of the new/modified API*
19+
- Issue: *If an issue exists for this change, a link to the issue*
20+
- Pull Request: *Link to the pull request(s) that introduces this change*
21+
- Migration steps: Steps that adopters of swift-syntax should take to move to the new API (required for deprecations and API-incompatible changes).
22+
- Notes: *In case of deprecations or API-incompatible changes, the reason why this change was made and the suggested alternative*
23+
24+
*Insert entries in chronological order, with newer entries at the bottom*

Sources/SwiftParser/Declarations.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,9 @@ extension Parser {
680680
// type parameters, not parameter packs or value generics yet.
681681
let defaultType: RawTypeInitializerClauseSyntax?
682682
if self.experimentalFeatures.contains(.defaultGenerics),
683-
specifier == nil,
684-
let equal = self.consume(if: .equal) {
683+
specifier == nil,
684+
let equal = self.consume(if: .equal)
685+
{
685686
let type = self.parseType()
686687
defaultType = RawTypeInitializerClauseSyntax(
687688
equal: equal,

Tests/SwiftParserTest/DefaultGenericsTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ final class DefaultGenericsTest: ParserTestCase {
7676
),
7777
DiagnosticSpec(
7878
message: "unexpected code '= Int>' in struct"
79-
)
79+
),
8080
],
8181
fixedSource: """
8282
struct A<each T> = Int> {}
@@ -98,7 +98,7 @@ final class DefaultGenericsTest: ParserTestCase {
9898
),
9999
DiagnosticSpec(
100100
message: "unexpected code '= Int>' in struct"
101-
)
101+
),
102102
],
103103
fixedSource: """
104104
struct A<let n: Int> = Int> {}

0 commit comments

Comments
 (0)