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

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

Issue 2899683003: Included setters in testing of the void => return-any-type feature. (Closed)
Patch Set: Created 3 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 | « no previous file | tests/language/void_arrow_return_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_checker_test.dart
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 0173d8d238286af875c2bc5131cceff43e432258..8ef5f3745accac23e69e22d693c325d72897c047 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -100,6 +100,8 @@ Future testReturn(MockCompiler compiler) {
check(returnWithType("void", 1), MessageKind.RETURN_VALUE_IN_VOID),
check(returnWithType("void", null)),
check(returnWithType("String", ""), MessageKind.RETURN_NOTHING),
+ check(arrowReturnWithType("void", "4")),
+ check("void set foo(x) => 5;"),
// check("String foo() {};"), // Should probably fail.
]);
}
@@ -2615,6 +2617,10 @@ String returnWithType(String type, expression) {
return "$type foo() { return $expression; }";
}
+String arrowReturnWithType(String type, expression) {
+ return "$type foo() => $expression;";
+}
+
Node parseExpression(String text) =>
parseBodyCode(text, (parser, token) => parser.parseExpression(token));
« no previous file with comments | « no previous file | tests/language/void_arrow_return_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698