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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10536031: Fix for issue 3401: Implement casts in Analyzer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java (revision 8336)
+++ compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java (working copy)
@@ -1737,7 +1737,7 @@
public void test_getType_binaryExpression() throws Exception {
AnalyzeLibraryResult libraryResult = analyzeLibrary(
- "f() {",
+ "f(var arg) {",
" var v1 = 1 + 2;",
" var v2 = 1 - 2;",
" var v3 = 1 * 2;",
@@ -1754,6 +1754,7 @@
" var v14 = 1 / 2.0;",
" var v15 = 1.0 ~/ 2.0;",
" var v16 = 1.0 ~/ 2;",
+ " var v17 = arg as int",
"}",
"");
assertInferredElementTypeString(libraryResult, "v1", "int");
@@ -1772,6 +1773,7 @@
assertInferredElementTypeString(libraryResult, "v14", "double");
assertInferredElementTypeString(libraryResult, "v15", "double");
assertInferredElementTypeString(libraryResult, "v16", "double");
+ assertInferredElementTypeString(libraryResult, "v17", "int");
}
/**

Powered by Google App Engine
This is Rietveld 408576698