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

Unified Diff: pkg/analyzer/test/generated/static_type_warning_code_test.dart

Issue 888943004: Implement new "yield*" type checking rules in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 6b5f0a75996aacd8f9059d17ab1d3dcad703daf1..bf70201e070b6f104bb73ac4fa6343379f517543 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -1772,6 +1772,17 @@ Stream<int> f() async* {
verify([source]);
}
+ void test_yield_each_async_non_stream() {
+ Source source = addSource('''
+f() async* {
+ yield* 0;
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+ verify([source]);
+ }
+
void test_yield_each_async_to_mistyped_stream() {
Source source = addSource('''
import 'dart:async';
@@ -1785,6 +1796,17 @@ Stream<String> g() => null;
verify([source]);
}
+ void test_yield_each_sync_non_iterable() {
+ Source source = addSource('''
+f() sync* {
+ yield* 0;
+}
+''');
+ resolve(source);
+ assertErrors(source, [StaticTypeWarningCode.YIELD_OF_INVALID_TYPE]);
+ verify([source]);
+ }
+
void test_yield_each_sync_to_mistyped_iterable() {
Source source = addSource('''
Iterable<int> f() sync* {
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | tests/language/async_await_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698