blob: ab479a741ccb40dd9c6371fab0340054ba404047 [file] [log] [blame]
// 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.
class T1 {}
class T2 {}
class T3 {}
class T4 {}
class T5 {}
abstract class A {
foo();
get bar;
bazz(a1, a2, a3, [a4, a5]);
}
class B extends A {
noSuchMethod(Invocation invocation) {
return new T1();
}
}
class C {
noSuchMethod(Invocation invocation) {
return new T2();
}
}
class D extends C implements A {}
class E implements A {
foo() => new T3();
noSuchMethod(Invocation invocation) {
return new T4();
}
}
class F {
twoArg(a1, a2) => new T1();
noSuchMethod(Invocation invocation) {
return new T2();
}
}
class G {
noSuchMethod(Invocation invocation) {
return new T5();
}
}
A bb = new B();
A dd = new D();
Function unknown;
getDynamic() => unknown.call();
main(List<String> args) {
print(bb.foo());
print(bb.bar);
print(bb.bazz(1, 2, 3, 4));
print(dd.foo());
print(dd.bar);
print(dd.bazz(1, 2, 3, 4));
new E();
A xx = getDynamic();
print(xx.bar);
dynamic yy = getDynamic();
print(yy.twoArg(1, 2, 3));
new F();
dynamic gg = new G();
print(gg.noSuchMethod(null, null));
}