mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 22:01:19 +00:00
b101a7d002
Change-Id: Ib33169c3e0ffc870915c189404074a1dea472546 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196548 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Leaf Petersen <leafp@google.com>
45 lines
924 B
Dart
45 lines
924 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
// @dart = 2.9
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class I<X> {}
|
|
|
|
class C0<T> extends I<T> {}
|
|
class C1<T> implements I<T> {}
|
|
|
|
mixin M0<T> on I<T> {
|
|
}
|
|
|
|
mixin M1<T> on I<T> {
|
|
T Function(T) get value => null;
|
|
}
|
|
|
|
mixin M2<T> implements I<T> {}
|
|
|
|
mixin M3<T> on I<T> {}
|
|
|
|
class J<X> {}
|
|
class C2 extends C1<int> implements J<double> {}
|
|
class C3 extends J<double> {}
|
|
|
|
mixin M4<S, T> on I<S>, J<T> {
|
|
S Function(S) get value0 => null;
|
|
T Function(T) get value1 => null;
|
|
}
|
|
|
|
// M1 is inferred as M1<int>
|
|
class B10 extends Object with I<int>, M3, M1 {
|
|
void check() {
|
|
// Verify that M1.T is exactly int
|
|
int Function(int) f = this.value;
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
Expect.type<M1<int>>(new B10()..check());
|
|
}
|