Skip to content

Commit b45d25b

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Print MethodElementImpl references in text expectations.
Change-Id: Ib2c7f1dbc2479d9f0731b02558f939430a5ccee2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431948 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent 63aa736 commit b45d25b

File tree

67 files changed

+1230
-1030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1230
-1030
lines changed

pkg/analyzer/test/generated/resolver_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ MethodInvocation
262262
operator: .
263263
methodName: SimpleIdentifier
264264
token: m
265-
element: <testLibraryFragment>::@class::B::@method::m#element
265+
element: <testLibrary>::@class::B::@method::m
266266
staticType: B Function()
267267
argumentList: ArgumentList
268268
leftParenthesis: (

pkg/analyzer/test/generated/simple_resolver_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ void main() {
12091209
assertResolvedNodeText(findNode.simple('f();'), r'''
12101210
SimpleIdentifier
12111211
token: f
1212-
element: <testLibraryFragment>::@mixin::M2::@method::f#element
1212+
element: <testLibrary>::@mixin::M2::@method::f
12131213
staticType: void Function()
12141214
''');
12151215
}
@@ -1233,7 +1233,7 @@ class C extends B with M1, M2 {
12331233
assertResolvedNodeText(findNode.simple('f();'), r'''
12341234
SimpleIdentifier
12351235
token: f
1236-
element: <testLibraryFragment>::@mixin::M2::@method::f#element
1236+
element: <testLibrary>::@mixin::M2::@method::f
12371237
staticType: void Function()
12381238
''');
12391239
}
@@ -1256,7 +1256,7 @@ void main() {
12561256
assertResolvedNodeText(findNode.simple('f();'), r'''
12571257
SimpleIdentifier
12581258
token: f
1259-
element: <testLibraryFragment>::@mixin::M2::@method::f#element
1259+
element: <testLibrary>::@mixin::M2::@method::f
12601260
staticType: void Function()
12611261
''');
12621262
}

pkg/analyzer/test/generated/strong_mode_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ MethodInvocation
21072107
methodName: SimpleIdentifier
21082108
token: fold
21092109
element: MethodMember
2110-
baseElement: <testLibraryFragment>::@class::Iterable::@method::fold#element
2110+
baseElement: <testLibrary>::@class::Iterable::@method::fold
21112111
substitution: {T: dynamic, S: S}
21122112
staticType: S Function<S>(S, S Function(S, dynamic))
21132113
argumentList: ArgumentList
@@ -4221,7 +4221,7 @@ MethodInvocation
42214221
methodName: SimpleIdentifier
42224222
token: map
42234223
element: MethodMember
4224-
baseElement: <testLibraryFragment>::@class::List::@method::map#element
4224+
baseElement: <testLibrary>::@class::List::@method::map
42254225
substitution: {E: dynamic, T: T}
42264226
staticType: T Function<T>(T Function(dynamic))
42274227
argumentList: ArgumentList
@@ -4265,7 +4265,7 @@ MethodInvocation
42654265
methodName: SimpleIdentifier
42664266
token: map
42674267
element: MethodMember
4268-
baseElement: <testLibraryFragment>::@class::List::@method::map#element
4268+
baseElement: <testLibrary>::@class::List::@method::map
42694269
substitution: {E: dynamic, T: T}
42704270
staticType: T Function<T>(T Function(dynamic))
42714271
argumentList: ArgumentList
@@ -4417,7 +4417,7 @@ MethodInvocation
44174417
methodName: SimpleIdentifier
44184418
token: f
44194419
element: MethodMember
4420-
baseElement: <testLibraryFragment>::@class::C::@method::f#element
4420+
baseElement: <testLibrary>::@class::C::@method::f
44214421
substitution: {T: S, S: S}
44224422
staticType: S Function<S₀>(S₀)
44234423
typeArguments: TypeArgumentList
@@ -4491,7 +4491,7 @@ MethodInvocation
44914491
methodName: SimpleIdentifier
44924492
token: f
44934493
element: MethodMember
4494-
baseElement: <testLibraryFragment>::@class::C::@method::f#element
4494+
baseElement: <testLibrary>::@class::C::@method::f
44954495
substitution: {T: S, S: S}
44964496
staticType: S Function<S₀ extends S>(S₀)
44974497
typeArguments: TypeArgumentList
@@ -4523,7 +4523,7 @@ MethodInvocation
45234523
SimpleIdentifier
45244524
token: f
45254525
element: MethodMember
4526-
baseElement: <testLibraryFragment>::@class::C::@method::f#element
4526+
baseElement: <testLibrary>::@class::C::@method::f
45274527
substitution: {T: S, S: S}
45284528
staticType: S Function<S₀ extends S>(S₀)
45294529
''');
@@ -5276,7 +5276,7 @@ class C<T> {
52765276
MethodInvocation
52775277
methodName: SimpleIdentifier
52785278
token: m
5279-
element: <testLibraryFragment>::@class::C::@method::m#element
5279+
element: <testLibrary>::@class::C::@method::m
52805280
staticType: void Function<S0 extends T, S1 extends List<S0>>(S0, S1)
52815281
argumentList: ArgumentList
52825282
leftParenthesis: (
@@ -5321,7 +5321,7 @@ class C<T> {
53215321
MethodInvocation
53225322
methodName: SimpleIdentifier
53235323
token: m
5324-
element: <testLibraryFragment>::@class::C::@method::m#element
5324+
element: <testLibrary>::@class::C::@method::m
53255325
staticType: Map<S0, S1> Function<S0 extends T, S1 extends List<S0>>()
53265326
argumentList: ArgumentList
53275327
leftParenthesis: (
@@ -5353,7 +5353,7 @@ class C<T> {
53535353
MethodInvocation
53545354
methodName: SimpleIdentifier
53555355
token: m
5356-
element: <testLibraryFragment>::@class::C::@method::m#element
5356+
element: <testLibrary>::@class::C::@method::m
53575357
staticType: void Function<S extends T>(S)
53585358
argumentList: ArgumentList
53595359
leftParenthesis: (
@@ -5391,7 +5391,7 @@ class C<T> {
53915391
MethodInvocation
53925392
methodName: SimpleIdentifier
53935393
token: m
5394-
element: <testLibraryFragment>::@class::C::@method::m#element
5394+
element: <testLibrary>::@class::C::@method::m
53955395
staticType: S Function<S extends T>()
53965396
argumentList: ArgumentList
53975397
leftParenthesis: (

pkg/analyzer/test/src/dart/ast/element_locator_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main() {
4545
var node = findNode.assignment('+=');
4646
var element = ElementLocator.locate2(node);
4747
_assertElement(element, r'''
48-
dart:core::<fragment>::@class::num::@method::+#element
48+
dart:core::@class::num::@method::+
4949
''');
5050
}
5151

@@ -54,7 +54,7 @@ dart:core::<fragment>::@class::num::@method::+#element
5454
var node = findNode.binary('+');
5555
var element = ElementLocator.locate2(node);
5656
_assertElement(element, r'''
57-
dart:core::<fragment>::@class::num::@method::+#element
57+
dart:core::@class::num::@method::+
5858
''');
5959
}
6060

@@ -166,7 +166,7 @@ void main() {
166166
var node = findNode.singleDotShorthandInvocation;
167167
var element = ElementLocator.locate2(node);
168168
_assertElement(element, r'''
169-
<testLibraryFragment>::@class::A::@method::foo#element
169+
<testLibrary>::@class::A::@method::foo
170170
''');
171171
}
172172

@@ -367,7 +367,7 @@ void main() {
367367
var element = ElementLocator.locate2(node);
368368
_assertElement(element, r'''
369369
MethodMember
370-
baseElement: dart:core::<fragment>::@class::List::@method::[]#element
370+
baseElement: dart:core::@class::List::@method::[]
371371
substitution: {E: int}
372372
''');
373373
}
@@ -449,7 +449,7 @@ class A {
449449
var node = findNode.methodDeclaration('foo');
450450
var element = ElementLocator.locate2(node);
451451
_assertElement(element, r'''
452-
<testLibraryFragment>::@class::A::@method::foo#element
452+
<testLibrary>::@class::A::@method::foo
453453
''');
454454
}
455455

@@ -466,7 +466,7 @@ void main() {
466466
var node = findNode.methodInvocation('foo();');
467467
var element = ElementLocator.locate2(node);
468468
_assertElement(element, r'''
469-
<testLibraryFragment>::@class::A::@method::foo#element
469+
<testLibrary>::@class::A::@method::foo
470470
''');
471471
}
472472

@@ -512,7 +512,7 @@ dart:core::<fragment>::@class::int::@getter::isEven#element
512512
var node = findNode.postfix('x++');
513513
var element = ElementLocator.locate2(node);
514514
_assertElement(element, r'''
515-
dart:core::<fragment>::@class::num::@method::+#element
515+
dart:core::@class::num::@method::+
516516
''');
517517
}
518518

@@ -547,7 +547,7 @@ dart:core::<fragment>::@class::int::@getter::isEven#element
547547
var node = findNode.prefix('++x');
548548
var element = ElementLocator.locate2(node);
549549
_assertElement(element, r'''
550-
dart:core::<fragment>::@class::num::@method::+#element
550+
dart:core::@class::num::@method::+
551551
''');
552552
}
553553

pkg/analyzer/test/src/dart/constant/evaluation_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,7 @@ const g = self.C.f;
31973197
var result = _topLevelVar('g');
31983198
assertDartObjectText(result, '''
31993199
void Function(int)
3200-
element: <testLibraryFragment>::@class::C::@method::f#element
3200+
element: <testLibrary>::@class::C::@method::f
32013201
variable: <testLibrary>::@topLevelVariable::g
32023202
''');
32033203
}
@@ -3213,7 +3213,7 @@ const void Function(int) g = self.C.f;
32133213
var result = _topLevelVar('g');
32143214
assertDartObjectText(result, '''
32153215
void Function(int)
3216-
element: <testLibraryFragment>::@class::C::@method::f#element
3216+
element: <testLibrary>::@class::C::@method::f
32173217
typeArguments
32183218
int
32193219
variable: <testLibrary>::@topLevelVariable::g
@@ -3231,7 +3231,7 @@ const g = self.E.f;
32313231
var result = _topLevelVar('g');
32323232
assertDartObjectText(result, '''
32333233
int Function(String)
3234-
element: <testLibraryFragment>::@extension::E::@method::f#element
3234+
element: <testLibrary>::@extension::E::@method::f
32353235
variable: <testLibrary>::@topLevelVariable::g
32363236
''');
32373237
}
@@ -3247,7 +3247,7 @@ const g = self.ET.f;
32473247
var result = _topLevelVar('g');
32483248
assertDartObjectText(result, '''
32493249
int Function(String)
3250-
element: <testLibraryFragment>::@extensionType::ET::@method::f#element
3250+
element: <testLibrary>::@extensionType::ET::@method::f
32513251
variable: <testLibrary>::@topLevelVariable::g
32523252
''');
32533253
}

0 commit comments

Comments
 (0)