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

Unified Diff: tests/compiler/dart2js/cpa_inference_test.dart

Issue 15853002: Handle local variable declarations without immediate assignment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Karl's comments Created 7 years, 7 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 | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/cpa_inference_test.dart
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index 01c79694576e2a459b797ce91f61686d9297f1a4..5a53ec9c28ecd4cfa0acd55a8205ad0bd09b8541 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -193,6 +193,20 @@ testDynamicBackDoor() {
result.checkNodeHasUnknownType('x');
}
+testVariableDeclaration() {
+ final String source = r"""
+ main() {
+ var v1;
+ var v2;
+ v2 = 1;
+ v1; v2;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType('v1', [result.nullType]);
+ result.checkNodeHasType('v2', [result.int]);
+}
+
testLiterals() {
final String source = r"""
main() {
@@ -1341,6 +1355,7 @@ testSelectors() {
void main() {
testDynamicBackDoor();
+ testVariableDeclaration();
testLiterals();
testRedefinition();
testIfThenElse();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698