Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: pkg/analysis_server/test/services/correction/name_suggestion_test.dart

Issue 2969343002: Stop depending of visiting LocalVariableElement(s) in Executableelement.visitChildren(). (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/abstract_single_unit.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/name_suggestion_test.dart
diff --git a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
index 80a32c99da4a0ed929474b5e7282127f2b2cadf0..d352a5ba29da666c9ec5f68a6408e7a8f6744019 100644
--- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
+++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
@@ -4,7 +4,6 @@
import 'package:analysis_server/src/services/correction/name_suggestion.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -40,7 +39,7 @@ main() {
}
''');
Set<String> excluded = new Set<String>.from([]);
- DartType expectedType = (findElement('node') as LocalVariableElement).type;
+ DartType expectedType = findLocalVariable('node').type;
Expression assignedExpression =
findNodeAtString('null;', (node) => node is NullLiteral);
List<String> suggestions = getVariableNameSuggestionsForExpression(
@@ -54,7 +53,7 @@ main() {
double res = 0.0;
}
''');
- DartType expectedType = (findElement('res') as LocalVariableElement).type;
+ DartType expectedType = findLocalVariable('res').type;
Expression assignedExpression = findNodeAtString('0.0;');
// first choice for "double" is "d"
expect(
@@ -74,7 +73,7 @@ main() {
int res = 0;
}
''');
- DartType expectedType = (findElement('res') as LocalVariableElement).type;
+ DartType expectedType = findLocalVariable('res').type;
Expression assignedExpression = findNodeAtString('0;');
// first choice for "int" is "i"
expect(
@@ -94,7 +93,7 @@ main() {
String res = 'abc';
}
''');
- DartType expectedType = (findElement('res') as LocalVariableElement).type;
+ DartType expectedType = findLocalVariable('res').type;
Expression assignedExpression = findNodeAtString("'abc';");
// first choice for "String" is "s"
expect(
« no previous file with comments | « pkg/analysis_server/test/abstract_single_unit.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698