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

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

Issue 8438042: https://code.google.com/p/dart/issues/detail?id=182 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (revision 1098)
+++ compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (working copy)
@@ -559,8 +559,8 @@
analyze(returnWithType("String", null));
analyze(returnWithType("int", null));
analyze(returnWithType("void", ""));
- analyzeFail(returnWithType("void", 1), TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
- analyzeFail(returnWithType("void", null), TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
+ analyzeFail(returnWithType("void", 1), TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyze(returnWithType("void", null));
analyzeFail(returnWithType("String", ""), TypeErrorCode.MISSING_RETURN_VALUE);
analyze("String foo() {};"); // Should probably fail, http://b/4484060.
}
@@ -1156,10 +1156,10 @@
public void testVoid() {
// Return a value from a void function.
analyze("void f() { return; }");
- analyzeFail("void f() { return null; }", TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
- analyzeFail("void f() { return f(); }", TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
- analyzeFail("void f() { return 1; }", TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
- analyzeFail("void f() { var x; return x; }", TypeErrorCode.VOID_CANNOT_RETURN_VALUE);
+ analyze("void f() { return null; }");
+ analyze("void f() { return f(); }");
+ analyzeFail("void f() { return 1; }", TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+ analyze("void f() { var x; return x; }");
// No-arg return from non-void function.
analyzeFail("int f() { return; }", TypeErrorCode.MISSING_RETURN_VALUE);
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698