Skip to content

Commit 11971d2

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Print 'parameter' for NamedExpression itself, not its value.
Change-Id: I9e8141a9f32dc85fc8c9b55a53ee9c561e029b1f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247041 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 0c796a5 commit 11971d2

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,11 @@ InstanceCreationExpression
656656
argumentList: ArgumentList
657657
leftParenthesis: (
658658
rightParenthesis: )
659-
parameter: <null>
660659
staticInvokeType: C? Function()
661660
staticType: C?
662661
typeArgumentTypes
663662
C?
663+
parameter: self::@class::X::@constructor::•::@parameter::c
664664
MethodInvocation
665665
methodName: SimpleIdentifier
666666
token: g2
@@ -689,11 +689,11 @@ InstanceCreationExpression
689689
argumentList: ArgumentList
690690
leftParenthesis: (
691691
rightParenthesis: )
692-
parameter: <null>
693692
staticInvokeType: D? Function()
694693
staticType: D?
695694
typeArgumentTypes
696695
D?
696+
parameter: self::@class::X::@constructor::•::@parameter::d
697697
rightParenthesis: )
698698
staticType: X
699699
''');

pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,11 @@ MethodInvocation
702702
argumentList: ArgumentList
703703
leftParenthesis: (
704704
rightParenthesis: )
705-
parameter: <null>
706705
staticInvokeType: C? Function()
707706
staticType: C?
708707
typeArgumentTypes
709708
C?
709+
parameter: self::@function::foo::@parameter::c
710710
MethodInvocation
711711
methodName: SimpleIdentifier
712712
token: g2
@@ -735,11 +735,11 @@ MethodInvocation
735735
argumentList: ArgumentList
736736
leftParenthesis: (
737737
rightParenthesis: )
738-
parameter: <null>
739738
staticInvokeType: D? Function()
740739
staticType: D?
741740
typeArgumentTypes
742741
D?
742+
parameter: self::@function::foo::@parameter::d
743743
rightParenthesis: )
744744
staticInvokeType: void Function(A, B, {C? c, D? d})
745745
staticType: void
@@ -7388,8 +7388,8 @@ MethodInvocation
73887388
colon: :
73897389
expression: BooleanLiteral
73907390
literal: false
7391-
parameter: <null>
73927391
staticType: bool
7392+
parameter: self::@function::foo::@parameter::b
73937393
NamedExpression
73947394
name: Label
73957395
label: SimpleIdentifier
@@ -7399,8 +7399,8 @@ MethodInvocation
73997399
colon: :
74007400
expression: IntegerLiteral
74017401
literal: 0
7402-
parameter: <null>
74037402
staticType: int
7403+
parameter: self::@function::foo::@parameter::a
74047404
rightParenthesis: )
74057405
staticInvokeType: void Function({int? a, bool? b})
74067406
staticType: void
@@ -7424,8 +7424,8 @@ MethodInvocation
74247424
colon: :
74257425
expression: BooleanLiteral
74267426
literal: false
7427-
parameter: <null>
74287427
staticType: bool*
7428+
parameter: self::@function::foo::@parameter::b
74297429
NamedExpression
74307430
name: Label
74317431
label: SimpleIdentifier
@@ -7435,8 +7435,8 @@ MethodInvocation
74357435
colon: :
74367436
expression: IntegerLiteral
74377437
literal: 0
7438-
parameter: <null>
74397438
staticType: int*
7439+
parameter: self::@function::foo::@parameter::a
74407440
rightParenthesis: )
74417441
staticInvokeType: void Function({int* a, bool* b})*
74427442
staticType: void

pkg/analyzer/test/src/summary/resolved_ast_printer.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ class ResolvedAstPrinter extends ThrowingAstVisitor<void> {
830830
_writeln('NamedExpression');
831831
_withIndent(() {
832832
_writeNamedChildEntities(node);
833+
_writeParameterElement(node);
833834
});
834835
}
835836

@@ -1461,8 +1462,7 @@ class ResolvedAstPrinter extends ThrowingAstVisitor<void> {
14611462
if (parent is ArgumentList ||
14621463
parent is AssignmentExpression && parent.rightHandSide == node ||
14631464
parent is BinaryExpression && parent.rightOperand == node ||
1464-
parent is IndexExpression && parent.index == node ||
1465-
parent is NamedExpression && parent.expression == node) {
1465+
parent is IndexExpression && parent.index == node) {
14661466
_writeElement('parameter', node.staticParameterElement);
14671467
}
14681468
}

0 commit comments

Comments
 (0)