d50903739c
always_declare_return_types unawaited_futures Enabled, fixed then disabled directives_ordering due to code generation Change-Id: Icaf7358222b1c9a939a4764be091e1956d449386 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253365 Commit-Queue: Mark Zhou <markzipan@google.com> Auto-Submit: Kevin Moore <kevmoo@google.com> Commit-Queue: Kevin Moore <kevmoo@google.com> Reviewed-by: Mark Zhou <markzipan@google.com>
46 lines
650 B
Dart
46 lines
650 B
Dart
import 'package:expect/expect.dart';
|
|
|
|
class Super<T> {
|
|
void method(T t) {
|
|
print(t.runtimeType);
|
|
}
|
|
}
|
|
|
|
class Mixin {
|
|
void method(int t) {
|
|
print(t + 1);
|
|
}
|
|
}
|
|
|
|
class Clazz = Super<int> with Mixin;
|
|
|
|
class Subclass extends Clazz {
|
|
void test() {
|
|
void Function(int) f = super.method;
|
|
f(42);
|
|
print(f);
|
|
}
|
|
}
|
|
|
|
class Subsub1 extends Subclass {
|
|
void a(dynamic x) {
|
|
print(x);
|
|
}
|
|
}
|
|
|
|
class Subsub2 extends Subclass {
|
|
void a(dynamic x) {
|
|
print(x);
|
|
print(x);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
Super<Object> s = Subclass()..test();
|
|
Expect.throws(() => s.method(''));
|
|
dynamic x = Subsub1();
|
|
x.a(x);
|
|
x = Subsub2();
|
|
x.a(x);
|
|
}
|