// 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.7 import 'package:expect/expect.dart'; /*spec.class: Class1a:explicit=[Class1a*]*/ class Class1a {} class Class1b extends Class1a {} /*spec.class: Class2a:explicit=[Class2a*],needsArgs*/ class Class2a {} class Class2b extends Class2a {} /*spec.member: method1:needsArgs,selectors=[Selector(call, call, arity=0, types=1)]*/ method1() => null; /*spec.member: method2:needsArgs,selectors=[Selector(call, call, arity=0, types=1)]*/ method2>() => null; method3() => null; class Class3 { /*spec.member: Class3.method4:needsArgs,selectors=[Selector(call, method4, arity=0, types=1)]*/ method4() => null; /*spec.member: Class3.method5:needsArgs,selectors=[Selector(call, method5, arity=0, types=1)]*/ method5>() => null; method6() => null; } /*spec.class: Class4:explicit=[Class4*]*/ class Class4 {} /*spec.member: method10:needsArgs*/ method10() => null; main() { /*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/ method7() => null; /*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/ method8>() => null; /*needsArgs,needsSignature,selectors=[Selector(call, call, arity=0, types=1)]*/method9() => null; dynamic f1 = method1; dynamic f2 = method2; dynamic f3 = method3; dynamic c3 = new Class3(); dynamic f7 = method7; dynamic f8 = method8; dynamic f9 = method9; f1(); f2>(); f3(); c3.method4(); c3.method5>(); c3.method6(); f7(); f8>(); f9(); if (typeAssertionsEnabled) { Expect.throws(/*needsSignature*/ () => f1>()); Expect.throws(/*needsSignature*/ () => f2>()); Expect.throws(/*needsSignature*/ () => c3.method4>()); Expect.throws(/*needsSignature*/ () => c3.method5>()); Expect.throws(/*needsSignature*/ () => f7>()); Expect.throws(/*needsSignature*/ () => f8>()); } else { f1>(); f2>(); c3.method4>(); c3.method5>(); f7>(); f8>(); } method10(); }