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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 2638183002: Issue 28027. Move Null to the bottom in the Analyzer. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 11 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
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 2f7c644cc16f4bd574786018d012f85129300279..0cd462ce858f5fe5e2ab527a98074f97dfaac6ef 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -1204,6 +1204,22 @@ main() {
}
}
+ test_assignment_throwExpression() async {
+ Source source = addSource(r'''
+f() {
+ var v = 1;
+ v = throw 2;
+ return v;
+}''');
+ CompilationUnit unit = await _computeResolvedUnit(source, noErrors: false);
+ FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+ BlockFunctionBody body =
+ function.functionExpression.body as BlockFunctionBody;
+ ReturnStatement statement = body.block.statements[2] as ReturnStatement;
+ SimpleIdentifier variableName = statement.expression as SimpleIdentifier;
+ expect(variableName.propagatedType, same(typeProvider.intType));
+ }
+
test_CanvasElement_getContext() async {
String code = r'''
import 'dart:html';
@@ -1595,6 +1611,21 @@ main() {
}
}
+ test_initializer_throwExpression() async {
+ Source source = addSource(r'''
+f() {
+ var v = throw 2;
+ return v;
+}''');
+ CompilationUnit unit = await _computeResolvedUnit(source, noErrors: false);
+ FunctionDeclaration function = unit.declarations[0] as FunctionDeclaration;
+ BlockFunctionBody body =
+ function.functionExpression.body as BlockFunctionBody;
+ var statement = body.block.statements[0] as VariableDeclarationStatement;
+ SimpleIdentifier variableName = statement.variables.variables[0].name;
+ expect(variableName.propagatedType, isNull);
+ }
+
test_invocation_target_prefixed() async {
addNamedSource(
'/helper.dart',
« no previous file with comments | « pkg/analyzer/test/generated/non_hint_code_test.dart ('k') | pkg/analyzer/test/generated/static_type_analyzer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698