// ── ILEmitterTests_Const__Body_Const_Folded_Arithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_Folded_Arithmetic topic: const status: verified // verified behavior: Test.test(...) == 19 namespace Test func test() -> int { const A = 3 const B = 4 return A * B + A + B } // ── ILEmitterTests_Const__Body_Const_In_For_Range_Start ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_In_For_Range_Start topic: const status: verified // verified behavior: Test.test(...) == 12 namespace Test func test() -> int { const FROM = 3 var sum = 0 for i in FROM..6 { sum = sum + i } return sum } // ── ILEmitterTests_Const__Body_Const_In_Return_Expression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_In_Return_Expression topic: const status: verified // verified behavior: Test.test(...) == 70 namespace Test func test(n: int) -> int { const SCALE = 10 return n * SCALE } // ── ILEmitterTests_Const__Body_Const_Passed_As_Arg ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_Passed_As_Arg topic: const status: verified // verified behavior: Test.test(...) == 21 namespace Test func triple(x: int) -> int = x * 3 func test() -> int { const N = 7 return triple(N) } // ── ILEmitterTests_Const__Body_Const_Shadowed_In_Inner_Scope ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_Shadowed_In_Inner_Scope topic: const status: verified // verified behavior: Test.test(...) == 101 namespace Test func test() -> int { const X = 1 var outer = X if true { const X = 100 outer = outer + X } return outer } // ── ILEmitterTests_Const__Body_Const_Used_Locally ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Body_Const_Used_Locally topic: const status: verified // verified behavior: Test.test(...) == 42 namespace Test func test() -> int { const X = 21 return X * 2 } // ── ILEmitterTests_Const__Pub_Toplevel_Const_Emits_Public_Literal_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Pub_Toplevel_Const_Emits_Public_Literal_Field topic: const status: verified // verified behavior: Test.test(...) == 7 namespace Test pub const VERSION = 7 func test() -> int = VERSION // ── ILEmitterTests_Const__Static_Func_Const_Block_Member ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Static_Func_Const_Block_Member topic: const status: verified // verified behavior: Test.test(...) == 50 namespace Test static func Caps { const MAX_USERS = 50 func limit() -> int = MAX_USERS } func test() -> int = Caps.limit() // ── ILEmitterTests_Const__Toplevel_Const_Bool ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Bool topic: const status: verified // verified behavior: Test.test(...) == true namespace Test const ENABLED = true func test() -> bool = ENABLED // ── ILEmitterTests_Const__Toplevel_Const_Bool_Expression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Bool_Expression topic: const status: verified // verified behavior: Test.test(...) == true namespace Test const ON = true const OFF = false func test() -> bool = ON and not OFF // ── ILEmitterTests_Const__Toplevel_Const_Double ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Double topic: const status: verified // verified behavior: Test.test(...) == 3.14 namespace Test const PI = 3.14 func test() -> double = PI // ── ILEmitterTests_Const__Toplevel_Const_Folded_Arithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Folded_Arithmetic topic: const status: verified // verified behavior: Test.test(...) == 60 namespace Test const SUM = 10 + 20 + 30 func test() -> int = SUM // ── ILEmitterTests_Const__Toplevel_Const_In_Arithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_In_Arithmetic topic: const status: verified // verified behavior: Test.test(...) == 105 namespace Test const BASE = 100 func test(x: int) -> int = BASE + x // ── ILEmitterTests_Const__Toplevel_Const_In_Comparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_In_Comparison topic: const status: verified // verified behavior: Test.is_big(...) == false namespace Test const THRESHOLD = 100 func is_big(n: int) -> bool = n > THRESHOLD // ── ILEmitterTests_Const__Toplevel_Const_In_Loop_Bound ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_In_Loop_Bound topic: const status: verified // verified behavior: Test.test(...) == 10 namespace Test const COUNT = 5 func test() -> int { var total = 0 for i in 0..COUNT { total = total + i } return total } // ── ILEmitterTests_Const__Toplevel_Const_Int_Used_In_Func ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Int_Used_In_Func topic: const status: verified // verified behavior: Test.test(...) == 1024 namespace Test const MAX = 1024 func test() -> int = MAX // ── ILEmitterTests_Const__Toplevel_Const_Negative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_Negative topic: const status: verified // verified behavior: Test.test(...) == -7 namespace Test const NEG = -7 func test() -> int = NEG // ── ILEmitterTests_Const__Toplevel_Const_References_Another_Const ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_References_Another_Const topic: const status: verified // verified behavior: Test.test(...) == 10 namespace Test const A = 5 const B = A * 2 func test() -> int = B // ── ILEmitterTests_Const__Toplevel_Const_String ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_String topic: const status: verified // verified behavior: Test.test(...) == "hello" namespace Test const GREETING = "hello" func test() -> string = GREETING // ── ILEmitterTests_Const__Toplevel_Const_String_Concat_Folded ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_String_Concat_Folded topic: const status: verified // verified behavior: Test.test(...) == "hello, world" namespace Test const PREFIX = "hello, " const NAME = "world" const GREETING = PREFIX + NAME func test() -> string = GREETING // ── ILEmitterTests_Const__Toplevel_Const_With_Type_Annotation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::Toplevel_Const_With_Type_Annotation topic: const status: verified // verified behavior: Test.test(...) == 42 namespace Test const N: int = 42 func test() -> int = N // ── ILEmitterTests_Const__RefData_Const_Member ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Const.cs::RefData_Const_Member topic: const status: unverified // verified behavior: Test.test(...) == 3 namespace Test ref data Config { const VERSION = 3 init() {} func version() -> int = self.VERSION } func test() -> int { let c = Config() return c.version() }