Add test demonstrating that FutureOr<A> <: FutureOr<B> =/=> A <: B.

Change-Id: Iedc60b57f80e77784e54b8d5ed9076c5016edd2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121653
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This commit is contained in:
Mayank Patke 2019-10-15 23:07:03 +00:00 committed by commit-bot@chromium.org
parent a73eba9823
commit 2baf675742

View file

@ -0,0 +1,16 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:expect/expect.dart';
class A implements Future<Future<A>> {
@override
noSuchMethod(Invocation _) {}
}
void main() {
Expect.notSubtype<A, Future<A>>();
Expect.subtype<FutureOr<A>, FutureOr<Future<A>>>();
}