| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| import "package:expect/expect.dart" as exp; |
| |
| import "package:expect/expect.dart"; |
| |
| static const field core::int constTwo = #C1; |
| static method function1() → core::int { |
| function add(core::int a, core::int b) → core::int |
| return a.{core::num::+}(b){(core::num) → core::int}; |
| return #C2; |
| } |
| static method function2() → core::int { |
| function addTwo(core::int a) → core::int { |
| core::int b = a.{core::num::+}(#C1){(core::num) → core::int}; |
| return b; |
| } |
| return #C3; |
| } |
| static method function3() → core::int { |
| function addTwoReturn(core::int a) → core::int |
| return a.{core::num::+}(#C1){(core::num) → core::int}; |
| return #C4; |
| } |
| static method function4() → core::int { |
| function addTwo(core::int a) → core::int |
| return a.{core::num::+}(#C1){(core::num) → core::int}; |
| return #C5; |
| } |
| static method function5() → core::int { |
| function typeFn<T extends core::Object? = dynamic>(T% a) → T% |
| return a; |
| return #C6; |
| } |
| static method function6() → core::int { |
| function optionalFn([core::int a = #C7]) → core::int |
| return a; |
| return #C8; |
| } |
| static method function7() → core::int { |
| function namedFn({core::int a = #C7}) → core::int |
| return a; |
| return #C1; |
| } |
| static method function8() → core::int { |
| function add(core::int a, core::int b) → core::int |
| return a.{core::num::+}(b){(core::num) → core::int}; |
| return (#C1).{core::num::+}(#C4){(core::num) → core::int}; |
| } |
| static method main() → void { |
| exp::Expect::equals(self::function1(), 12); |
| exp::Expect::equals(self::function2(), 4); |
| exp::Expect::equals(self::function3(), 5); |
| exp::Expect::equals(self::function4(), 22); |
| exp::Expect::equals(self::function5(), 3); |
| exp::Expect::equals(self::function6(), 1); |
| exp::Expect::equals(self::function7(), 2); |
| exp::Expect::equals(self::function8(), 7); |
| } |
| |
| constants { |
| #C1 = 2 |
| #C2 = 12 |
| #C3 = 4 |
| #C4 = 5 |
| #C5 = 22 |
| #C6 = 3 |
| #C7 = 0 |
| #C8 = 1 |
| } |
| |
| Extra constant evaluation status: |
| Evaluated: InstanceInvocation @ org-dartlang-testcase:///const_functions_local_functions.dart:61:16 -> IntConstant(7) |
| Extra constant evaluation: evaluated: 33, effectively constant: 1 |