Skip to content

Commit 1af4de2

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate AstToIRTest.
Change-Id: Ib3e742995a6d07440010ac9edce2e5532bb4ecfb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398921 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
1 parent 0649713 commit 1af4de2

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

pkg/analyzer/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ test/src/task/strong/dart2_inference_test.dart
243243
test/src/task/strong/inferred_type_test.dart
244244
test/src/utilities/extensions/analysis_session_test.dart
245245
test/src/utilities/extensions/library_element_test.dart
246-
test/src/wolf/ir/ast_to_ir_test.dart
247246
test/util/element_printer.dart
248247
test/util/element_type_matchers.dart
249248
test/util/id_testing_helper.dart

pkg/analyzer/test/src/wolf/ir/ast_to_ir_test.dart

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test(C c, int other) => c $op other;
6969
check(astNodes)[findNode.binary('c $op other')]
7070
..containsSubrange(astNodes[findNode.simple('c $op')]!)
7171
..containsSubrange(astNodes[findNode.simple('other;')]!);
72-
var c = Instance(findElement.class_('C').thisType);
72+
var c = Instance(findElement2.class_('C').thisType);
7373
_callHandlers['C.$op'] = binaryFunction<Instance, int>((this_, other) {
7474
check(this_).identicalTo(c);
7575
check(other).equals(123);
@@ -90,8 +90,8 @@ test(List<C> list, int other) => list.first $op= other;
9090
..containsSubrange(astNodes[findNode.simple('list.first')]!)
9191
..containsSubrange(astNodes[findNode.prefixed('list.first')]!)
9292
..containsSubrange(astNodes[findNode.simple('other;')]!);
93-
var c = Instance(findElement.class_('C').thisType);
94-
var result = Instance(findElement.class_('C').thisType);
93+
var c = Instance(findElement2.class_('C').thisType);
94+
var result = Instance(findElement2.class_('C').thisType);
9595
_callHandlers['C.$op'] = binaryFunction<Instance, int>((this_, other) {
9696
check(this_).identicalTo(c);
9797
check(other).equals(123);
@@ -372,7 +372,7 @@ test(C? c) => c?.p ??= hook(123, '123');
372372
_callHandlers['C.p'] = unaryFunction<Instance>((c) => hook(p, 'c.p'));
373373
_callHandlers['C.p='] = binaryFunction<Instance, int?>(
374374
(c, value) => hook(p = value, 'c.p=$value'));
375-
var c = Instance(findElement.class_('C').thisType);
375+
var c = Instance(findElement2.class_('C').thisType);
376376
expectHooks([], () => check(runInterpreter([null])).equals(null));
377377
expectHooks(['c.p', '123', 'c.p=123'],
378378
() => check(runInterpreter([c])).equals(123));
@@ -429,7 +429,7 @@ test(C c) => c.p ??= hook(123, '123');
429429
_callHandlers['C.p'] = unaryFunction<Instance>((c) => hook(p, 'c.p'));
430430
_callHandlers['C.p='] = binaryFunction<Instance, int?>(
431431
(c, value) => hook(p = value, 'c.p=$value'));
432-
var c = Instance(findElement.class_('C').thisType);
432+
var c = Instance(findElement2.class_('C').thisType);
433433
expectHooks(['c.p', '123', 'c.p=123'],
434434
() => check(runInterpreter([c])).equals(123));
435435
check(p).equals(123);
@@ -484,7 +484,7 @@ test(C c) => (c).p ??= hook(123, '123');
484484
_callHandlers['C.p'] = unaryFunction<Instance>((c) => hook(p, 'c.p'));
485485
_callHandlers['C.p='] = binaryFunction<Instance, int?>(
486486
(c, value) => hook(p = value, 'c.p=$value'));
487-
var c = Instance(findElement.class_('C').thisType);
487+
var c = Instance(findElement2.class_('C').thisType);
488488
expectHooks(['c.p', '123', 'c.p=123'],
489489
() => check(runInterpreter([c])).equals(123));
490490
check(p).equals(123);
@@ -539,7 +539,7 @@ class C {
539539
_callHandlers['C.p'] = unaryFunction<Instance>((c) => hook(p, 'c.p'));
540540
_callHandlers['C.p='] = binaryFunction<Instance, int?>(
541541
(c, value) => hook(p = value, 'c.p=$value'));
542-
var c = Instance(findElement.class_('C').thisType);
542+
var c = Instance(findElement2.class_('C').thisType);
543543
expectHooks(['c.p', '123', 'c.p=123'],
544544
() => check(runInterpreter([c])).equals(123));
545545
check(p).equals(123);
@@ -1077,7 +1077,7 @@ class C {
10771077
analyze(findNode.methodDeclaration('test'));
10781078
check(astNodes)[findNode.methodInvocation('f(x)')]
10791079
.containsSubrange(astNodes[findNode.simple('x); // invocation')]!);
1080-
var c = Instance(findElement.class_('C').thisType);
1080+
var c = Instance(findElement2.class_('C').thisType);
10811081
_callHandlers['C.f'] = binaryFunction<Instance, int>((this_, x) {
10821082
check(this_).identicalTo(c);
10831083
check(x).equals(123);
@@ -1141,7 +1141,7 @@ class C {
11411141
check(x).equals(123);
11421142
return 456;
11431143
});
1144-
var c = Instance(findElement.class_('C').thisType);
1144+
var c = Instance(findElement2.class_('C').thisType);
11451145
check(runInterpreter([c, 123])).equals(456);
11461146
}
11471147

@@ -1654,7 +1654,7 @@ class C {
16541654
''');
16551655
analyze(findNode.singleMethodDeclaration);
16561656
check(astNodes).containsNode(findNode.this_('this'));
1657-
var thisValue = Instance(findElement.class_('C').thisType);
1657+
var thisValue = Instance(findElement2.class_('C').thisType);
16581658
check(runInterpreter([thisValue])).identicalTo(thisValue);
16591659
}
16601660

@@ -1844,8 +1844,7 @@ class AstToIRTestBase extends PubPackageResolutionTest {
18441844
eventListener: astNodes,
18451845
);
18461846
default:
1847-
throw UnimplementedError(
1848-
'TODO(paulberry): ${declaration.declaredElement}');
1847+
throw UnimplementedError('TODO(paulberry): $declaration');
18491848
}
18501849
validate(ir);
18511850
scopes = analyzeScopes(ir);

0 commit comments

Comments
 (0)