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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2654733003: Make Stream abstract as it is in the actual SDK. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 03567041782c7dcead4d8f428cbf5cd9c8b58343..7a3c312e1673bc5d16b61bbf7c23148ab084c897 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -923,9 +923,14 @@ Future test() async {
void test_downwardsInferenceForEach() {
checkFile('''
import 'dart:async';
+
+abstract class MyStream<T> extends Stream<T> {
+ factory MyStream() => null;
+}
+
Future main() async {
for(int x in /*info:INFERRED_TYPE_LITERAL*/[1, 2, 3]) {}
- await for(int x in /*info:INFERRED_TYPE_ALLOCATION*/new Stream()) {}
+ await for(int x in /*info:INFERRED_TYPE_ALLOCATION*/new MyStream()) {}
}
''');
}
@@ -1564,11 +1569,16 @@ void main() {
void test_downwardsInferenceYieldYieldStar() {
checkFile('''
import 'dart:async';
+
+abstract class MyStream<T> extends Stream<T> {
+ factory MyStream() => null;
+}
+
Stream<List<int>> foo() async* {
yield /*info:INFERRED_TYPE_LITERAL*/[];
- yield /*error:YIELD_OF_INVALID_TYPE*/new Stream();
+ yield /*error:YIELD_OF_INVALID_TYPE*/new MyStream();
yield* /*error:YIELD_OF_INVALID_TYPE*/[];
- yield* /*info:INFERRED_TYPE_ALLOCATION*/new Stream();
+ yield* /*info:INFERRED_TYPE_ALLOCATION*/new MyStream();
}
Iterable<Map<int, int>> bar() sync* {
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698