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

Unified Diff: pkg/compiler/lib/src/typechecker.dart

Issue 1367433002: Avoid warning when using `return;` from sync* and async* functions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix mock_libraries modification Created 5 years, 3 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/compiler/dart2js/mock_libraries.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/typechecker.dart
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 323c19db73bf53503e3be49d82ec0bf79c3e23b1..6ca167a27f0193c6d9c913a2896aa6a2e424a1d3 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -1655,7 +1655,7 @@ class TypeCheckerVisitor extends Visitor<DartType> {
checkAssignable(expression, expressionType, expectedReturnType);
}
}
- } else if (currentAsyncMarker == AsyncMarker.ASYNC) {
+ } else if (currentAsyncMarker != AsyncMarker.SYNC) {
// `return;` is allowed.
} else if (!types.isAssignable(expectedReturnType, const VoidType())) {
// Let f be the function immediately enclosing a return statement of the
« no previous file with comments | « no previous file | tests/compiler/dart2js/mock_libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698