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

Unified Diff: tests/lib_2/async/future_or_bad_type_test.dart

Issue 2999943002: Migrated test block 168 to Dart 2.0. (Closed)
Patch Set: Fixed async/future_test.dart Created 3 years, 4 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: tests/lib_2/async/future_or_bad_type_test.dart
diff --git a/tests/lib_strong/async/future_or_bad_type_test.dart b/tests/lib_2/async/future_or_bad_type_test.dart
similarity index 65%
rename from tests/lib_strong/async/future_or_bad_type_test.dart
rename to tests/lib_2/async/future_or_bad_type_test.dart
index eb0933ae544374ebf7d2408e0c7939de677caf63..fc47e02288a91b40639e6e4edd7636f7a42a630f 100644
--- a/tests/lib_strong/async/future_or_bad_type_test.dart
+++ b/tests/lib_2/async/future_or_bad_type_test.dart
@@ -10,17 +10,15 @@ import 'dart:async';
import 'package:expect/expect.dart';
class A
- extends FutureOr<String> // //# extends: compile-time error
- extends Object with FutureOr<bool> // //# with: compile-time error
- implements FutureOr<int> // //# implements: compile-time error
+ extends FutureOr<String> //# extends: compile-time error
+ extends Object with FutureOr<bool> //# with: compile-time error
+ implements FutureOr<int> //# implements: ok
Bob Nystrom 2017/08/16 22:27:20 Why is this OK now? Isn't it an error to implement
bkonyi 2017/08/16 23:44:13 I thought so, but apparently this doesn't fail any
Bob Nystrom 2017/08/16 23:47:32 I think it should be failing. If an implementation
{}
main() {
// FutureOr<T> should be treated like `dynamic`. Dynamically the `T` is
// completely ignored. It can be a malformed type.
Bob Nystrom 2017/08/16 22:27:20 This is testing the old 1.0 behavior. In 2.0, it s
bkonyi 2017/08/16 23:44:13 Done.
Expect.isTrue(499 is FutureOr<A>);
- Expect.isTrue(499 is FutureOr<Does<Not<Exist>>>); // //# 00: static type warning
- Expect.isTrue(499 is FutureOr<A, A>); // //# 01: static type warning
var a = new A();
Expect.isTrue(a.toString() is String);

Powered by Google App Engine
This is Rietveld 408576698