You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/RenamedChildrenBuilderCompatibilityFile.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ let renamedChildrenBuilderCompatibilityFile = try! SourceFileSyntax(leadingTrivi
"child '\(child.name)' is named inconsistently with '\(children.first!.node.kind.syntaxType).\(children.first!.child.name)', which has the same type ('\(kind.syntaxType)')"
425
+
"child '\(child.name)' is named inconsistently with '\(mostCommonChild.node.kind.syntaxType).\(mostCommonChildName)', which has the same type ('\(kind.syntaxType)')"
409
426
)
410
427
)
411
428
}
@@ -415,99 +432,45 @@ class ValidateSyntaxNodes: XCTestCase {
415
432
assertFailuresMatchXFails(
416
433
failures,
417
434
expectedFailures:[
418
-
ValidationFailure(
419
-
node:.differentiableAttributeArguments,
420
-
message:"child 'WhereClause' is named inconsistently with 'ActorDeclSyntax.GenericWhereClause', which has the same type ('GenericWhereClauseSyntax')"
421
-
),
422
-
ValidationFailure(
423
-
node:.subscriptDecl,
424
-
message:"child 'Indices' is named inconsistently with 'FunctionSignatureSyntax.Input', which has the same type ('ParameterClauseSyntax')"
425
-
),
435
+
// MARK: DeclNameArguments
436
+
// FIXME: IdentifierExprSyntax etc. should probably use DeclName as child instead of Name and Arguments
426
437
ValidationFailure(
427
438
node:.qualifiedDeclName,
428
-
message:"child 'Arguments' is named inconsistently with 'DeclNameSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')"
439
+
message:
440
+
"child 'Arguments' is named inconsistently with 'IdentifierExprSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')"
429
441
),
430
442
ValidationFailure(
431
-
node:.macroExpansionDecl,
443
+
node:.declName,
432
444
message:
433
-
"child 'GenericArguments' is named inconsistently with 'KeyPathPropertyComponentSyntax.GenericArgumentClause', which has the same type ('GenericArgumentClauseSyntax')"
445
+
"child 'Arguments' is named inconsistently with 'IdentifierExprSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')"
434
446
),
447
+
// MARK: Alternate names for InitializerClauseSyntax
448
+
// The cases below don’t have intializers but just a syntactic element that happens to be spelled the same
435
449
ValidationFailure(
436
-
node:.macroExpansionExpr,
450
+
node:.enumCaseElement,
437
451
message:
438
-
"child 'GenericArguments' is named inconsistently with 'KeyPathPropertyComponentSyntax.GenericArgumentClause', which has the same type ('GenericArgumentClauseSyntax')"
452
+
"child 'RawValue' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')"
439
453
),
440
454
ValidationFailure(
441
455
node:.enumCaseParameter,
442
-
message:"child 'DefaultArgument' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
456
+
message:
457
+
"child 'DefaultArgument' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')"
443
458
),
444
459
ValidationFailure(
445
460
node:.functionParameter,
446
-
message:"child 'DefaultArgument' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
461
+
message:
462
+
"child 'DefaultArgument' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')"
447
463
),
448
464
ValidationFailure(
449
465
node:.macroDecl,
450
-
message:"child 'Definition' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
451
-
),
452
-
ValidationFailure(
453
-
node:.matchingPatternCondition,
454
-
message:"child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
455
-
),
456
-
ValidationFailure(
457
-
node:.optionalBindingCondition,
458
-
message:"child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
459
-
),
460
-
ValidationFailure(
461
-
node:.patternBinding,
462
-
message:"child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
463
-
),
464
-
ValidationFailure(
465
-
node:.tupleTypeElement,
466
-
message:"child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')"
466
+
message:
467
+
"child 'Definition' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')"
467
468
),
469
+
// MARK: Miscellaneous
468
470
ValidationFailure(
469
471
node:.multipleTrailingClosureElement,
470
472
message:"child 'Closure' is named inconsistently with 'FunctionCallExprSyntax.TrailingClosure', which has the same type ('ClosureExprSyntax')"
471
473
),
472
-
ValidationFailure(
473
-
node:.subscriptDecl,
474
-
message:"child 'Result' is named inconsistently with 'ClosureSignatureSyntax.Output', which has the same type ('ReturnClauseSyntax')"
475
-
),
476
-
ValidationFailure(
477
-
node:.canImportVersionInfo,
478
-
message:
479
-
"child 'VersionTuple' is named inconsistently with 'AvailabilityVersionRestrictionSyntax.Version', which has the same type ('VersionTupleSyntax')"
480
-
),
481
-
ValidationFailure(
482
-
node:.exposeAttributeArguments,
483
-
message:
484
-
"child 'CxxName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
485
-
),
486
-
ValidationFailure(
487
-
node:.opaqueReturnTypeOfAttributeArguments,
488
-
message:
489
-
"child 'MangledName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
490
-
),
491
-
ValidationFailure(
492
-
node:.originallyDefinedInArguments,
493
-
message:
494
-
"child 'ModuleName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
495
-
),
496
-
ValidationFailure(
497
-
node:.poundSourceLocationArgs,
498
-
message:
499
-
"child 'FileName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
500
-
),
501
-
ValidationFailure(
502
-
node:.unavailableFromAsyncArguments,
503
-
message:
504
-
"child 'Message' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
505
-
),
506
-
ValidationFailure(
507
-
node:.underscorePrivateAttributeArguments,
508
-
message:
509
-
"child 'Filename' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')"
0 commit comments