Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ValueGenerics feature from swift-syntax #3022

Merged
merged 3 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public enum ExperimentalFeature: String, CaseIterable {
case nonescapableTypes
case trailingComma
case coroutineAccessors
case valueGenerics
case abiAttribute
case keypathWithMethodMembers
case oldOwnershipOperatorSpellings
Expand All @@ -40,8 +39,6 @@ public enum ExperimentalFeature: String, CaseIterable {
return "TrailingComma"
case .coroutineAccessors:
return "CoroutineAccessors"
case .valueGenerics:
return "ValueGenerics"
case .abiAttribute:
return "ABIAttribute"
case .keypathWithMethodMembers:
Expand All @@ -68,8 +65,6 @@ public enum ExperimentalFeature: String, CaseIterable {
return "trailing commas"
case .coroutineAccessors:
return "coroutine accessors"
case .valueGenerics:
return "value generics"
case .abiAttribute:
return "@abi attribute"
case .keypathWithMethodMembers:
Expand Down
6 changes: 2 additions & 4 deletions CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ public let GENERIC_NODES: [Node] = [
),
Child(
name: "expr",
kind: .node(kind: .expr),
experimentalFeature: .valueGenerics
kind: .node(kind: .expr)
),
]),
nameForDiagnostics: "left-hand type",
Expand All @@ -362,8 +361,7 @@ public let GENERIC_NODES: [Node] = [
),
Child(
name: "expr",
kind: .node(kind: .expr),
experimentalFeature: .valueGenerics
kind: .node(kind: .expr)
),
]),
nameForDiagnostics: "right-hand type",
Expand Down
3 changes: 1 addition & 2 deletions CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ public let TYPE_NODES: [Node] = [
),
Child(
name: "expr",
kind: .node(kind: .expr),
experimentalFeature: .valueGenerics
kind: .node(kind: .expr)
),
]),
documentation:
Expand Down
6 changes: 0 additions & 6 deletions Sources/SwiftParser/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1233,12 +1233,6 @@ extension Parser {

extension Parser {
mutating func parseValueType() -> RawExprSyntax? {
// If the 'ValueGenerics' experimental feature hasn't been added, then don't
// attempt to parse values as types.
guard self.experimentalFeatures.contains(.valueGenerics) else {
return nil
}

// Eat any '-' preceding integer literals.
var minusSign: RawTokenSyntax? = nil
if self.atContextualPunctuator("-"),
Expand Down
13 changes: 4 additions & 9 deletions Sources/SwiftParser/generated/ExperimentalFeatures.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesGHI.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Sources/SwiftSyntax/generated/raw/RawSyntaxNodesQRS.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tests/SwiftParserTest/ExpressionTypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ final class ExpressionTypeTests: ParserTestCase {
{ ExprSyntax.parse(from: &$0) },
substructure: IdentifierTypeSyntax(name: .identifier("X")),
substructureAfterMarker: "1️⃣",
experimentalFeatures: [.inlineArrayTypeSugar, .valueGenerics],
experimentalFeatures: [.inlineArrayTypeSugar],
line: line
)
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftParserTest/TypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ final class TypeTests: ParserTestCase {

final class InlineArrayTypeTests: ParserTestCase {
override var experimentalFeatures: Parser.ExperimentalFeatures {
[.inlineArrayTypeSugar, .valueGenerics]
[.inlineArrayTypeSugar]
}

func testBasic() {
Expand Down
Loading