4bf22f41f3
Change-Id: Ideee9917b2e5b819672c7e441d051f9bc57c86c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366342 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
30 lines
878 B
Plaintext
30 lines
878 B
Plaintext
library;
|
|
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 b = #C1;
|
|
static method fn(core::int a) → core::int {
|
|
if(a =={core::num::==}{(core::Object) → core::bool} 1)
|
|
return 1;
|
|
return a.{core::num::*}(self::fn(a.{core::num::-}(1){(core::num) → core::int})){(core::num) → core::int};
|
|
}
|
|
static method localTest() → core::int {
|
|
function fnLocal(core::int a) → core::int {
|
|
if(a =={core::num::==}{(core::Object) → core::bool} 1)
|
|
return 1;
|
|
return a.{core::num::*}(fnLocal(a.{core::num::-}(1){(core::num) → core::int}){(core::int) → core::int}){(core::num) → core::int};
|
|
}
|
|
return #C1;
|
|
}
|
|
static method main() → void {
|
|
exp::Expect::equals(#C1, 24);
|
|
exp::Expect::equals(self::localTest(), 24);
|
|
}
|
|
|
|
constants {
|
|
#C1 = 24
|
|
}
|