mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
Migrate language_2/subtyping_static to NNBD.
Change-Id: I94ea79417ae39f64f558d55489000d720c3191e1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151092 Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
f2fafcd440
commit
85f6c01fc4
4
tests/language/subtyping_static/README.md
Normal file
4
tests/language/subtyping_static/README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Feature tests for static analysis involving subtyping
|
||||
|
||||
This directory was created in order to hold tests pertaining to the
|
||||
static analysis of Dart where it involves subtyping.
|
16
tests/language/subtyping_static/future_or_subtype_test.dart
Normal file
16
tests/language/subtyping_static/future_or_subtype_test.dart
Normal 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>>>();
|
||||
}
|
Loading…
Reference in a new issue