| 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 binary = #C1; |
| static const field core::int optional = #C2; |
| static const field core::int optional1 = #C3; |
| static const field core::int named = #C4; |
| static const field core::int named1 = #C5; |
| static const field core::int type = #C6; |
| static const field core::String str = #C7; |
| static const field core::bool eq = #C8; |
| static const field core::int negative = #C9; |
| static const field core::bool boolean = #C8; |
| static const field core::double doubleResult = #C10; |
| static const field core::int multi = #C2; |
| static const field core::int multi2 = #C3; |
| static method binaryFn(core::int a, core::int b) → core::int |
| return a.{core::num::-}(b){(core::num) → core::int}; |
| static method optionalFn(core::int c, [core::int d = #C11]) → core::int |
| return c.{core::num::+}(d){(core::num) → core::int}; |
| static method namedFn(core::int e, {core::int f = #C3}) → core::int |
| return e.{core::num::+}(f){(core::num) → core::int}; |
| static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T% |
| return x; |
| static method stringFn(core::String s) → core::String |
| return s.{core::String::+}("ing"){(core::String) → core::String}; |
| static method equalFn(core::int a, core::int b) → core::bool |
| return a =={core::num::==}{(core::Object) → core::bool} b; |
| static method unary(core::int a) → core::int |
| return a.{core::int::unary-}(){() → core::int}; |
| static method boolFn(core::bool a, core::bool b) → core::bool |
| return a || b; |
| static method doubleFn(core::double a, core::double b) → core::double |
| return a.{core::double::*}(b){(core::num) → core::double}; |
| static method multiFn(core::int a) → core::int |
| return a.{core::num::+}(1){(core::num) → core::int}; |
| static method main() → void { |
| exp::Expect::equals(#C1, 1); |
| exp::Expect::equals(#C2, 2); |
| exp::Expect::equals(#C3, 3); |
| exp::Expect::equals(#C4, 4); |
| exp::Expect::equals(#C5, 5); |
| exp::Expect::equals(#C6, 6); |
| exp::Expect::equals(#C7, "string"); |
| exp::Expect::equals(#C8, true); |
| exp::Expect::equals(#C9, 2.{core::int::unary-}(){() → core::int}); |
| exp::Expect::equals(#C8, true); |
| exp::Expect::equals(#C10, 4.4); |
| exp::Expect::equals(#C2, 2); |
| exp::Expect::equals(#C3, 3); |
| } |
| |
| constants { |
| #C1 = 1 |
| #C2 = 2 |
| #C3 = 3 |
| #C4 = 4 |
| #C5 = 5 |
| #C6 = 6 |
| #C7 = "string" |
| #C8 = true |
| #C9 = -2 |
| #C10 = 4.4 |
| #C11 = 0 |
| } |
| |
| Extra constant evaluation status: |
| Evaluated: InstanceInvocation @ org-dartlang-testcase:///const_functions_simple_invocations.dart:51:27 -> IntConstant(-2) |
| Extra constant evaluation: evaluated: 39, effectively constant: 1 |