// ── EmitterStressTests__NullConditionalChainWithCoalesce ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::NullConditionalChainWithCoalesce topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T func safe(s: string) -> int { return s?.Length ?? 0 } func ternaryChain(x: int) -> string { let label = x > 100 ? "high" : x > 50 ? "mid" : "low" return label } // ── EmitterStressTests__TryCatchWithTypedBinding ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::TryCatchWithTypedBinding topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T func run() -> string { try { let x = 1 / 0 return "ok" } catch (Exception ex) { return ex.Message } } // ── FeatureMixingTests__Char_LetThenCompare ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Char_LetThenCompare topic: core status: verified // verified behavior: Test.check(...) == false namespace Test func check(s: string, i: int) -> bool { let target = 'X' return s[i] == target } // ── FeatureMixingTests__Char_LiteralEqualityAgainstStringIndex ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Char_LiteralEqualityAgainstStringIndex topic: core status: verified // verified behavior: Test.isNewline(...) == true namespace Test func isSpace(s: string, i: int) -> bool { return s[i] == ' ' } func isQuote(s: string, i: int) -> bool { return s[i] == '"' } func isNewline(s: string, i: int) -> bool { return s[i] == '\n' } // ── FeatureMixingTests__Char_PassedToBclMethod ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Char_PassedToBclMethod topic: core status: verified // verified behavior: Test.isLetterAt(...) == false namespace Test func isLetterAt(s: string, i: int) -> bool { return char.IsLetter(s[i]) } func isDigitAt(s: string, i: int) -> bool { return char.IsDigit(s[i]) } // ── ILEmitterTests__Attributes_OnFunction_EmittedAsCLRAttributes ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Attributes_OnFunction_EmittedAsCLRAttributes topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [Obsolete] func oldMethod() -> int { return 0 } // ── ILEmitterTests__ByRef_MutatesThroughPointer ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ByRef_MutatesThroughPointer topic: core status: verified // verified behavior: Test.run(...) == 15 namespace Test func addTen(x: *int) { x += 10 } func run() -> int { var n = 5 addTen(*n) return n } // ── ILEmitterTests__Closure_CapturedLet_ReadsCorrectly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Closure_CapturedLet_ReadsCorrectly topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func makeAdder(base: int) -> int { let offset = 100 let add = func(x: int) -> int { return offset + x } return add(base) } // ── ILEmitterTests__Closure_CapturedVar_MutationPropagates ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Closure_CapturedVar_MutationPropagates topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func evalWith(value: int, offset: int) -> int { var total = 0 let addTo = func(v: int) { total = total + v } addTo(value) addTo(offset) return total } // ── ILEmitterTests__Closure_NoCaptureIL_EmitsDelegate ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Closure_NoCaptureIL_EmitsDelegate topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func apply(f: int, g: int) -> int { let double = func(x: int) -> int { return x * 2 } return double(f) } // ── ILEmitterTests__CompoundAssignment_IL_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::CompoundAssignment_IL_Runtime topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func accumulate(n: int) -> int { var total = 0 total += n total += n total -= 1 return total } // ── ILEmitterTests__Default_BoolIsFalse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Default_BoolIsFalse topic: core status: verified // verified behavior: Test.run(...) == false namespace Test func run() -> bool { let b = default(bool) return b } // ── ILEmitterTests__Default_IntIsZero ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Default_IntIsZero topic: core status: verified // verified behavior: Test.run(...) == 0 namespace Test func run() -> int { let x = default(int) return x } // ── ILEmitterTests__DelegateInvoke_ActionVoid_IL_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DelegateInvoke_ActionVoid_IL_Runtime topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func runCallback(x: int) -> int { var result = 0 let cb = func(v: int) { result = v * 2 } cb(x) return result } // ── ILEmitterTests__EntryPoint_Transpiler_EmitsMain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::EntryPoint_Transpiler_EmitsMain topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func main() { var x = 42 } // ── ILEmitterTests__Event_Subscribe_ObservableCollectionCollectionChanged ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Event_Subscribe_ObservableCollectionCollectionChanged topic: core status: verified // verified behavior: Test.run(...) == 2 namespace Test func run() -> int { var fired = 0 let coll = ObservableCollection() coll.CollectionChanged += func(sender: object, args: NotifyCollectionChangedEventArgs) -> void { fired = fired + 1 } coll.Add(10) coll.Add(20) return fired } // ── ILEmitterTests__ExpressionBodied_SimpleReturn ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ExpressionBodied_SimpleReturn topic: core status: verified // verified behavior: Test.always42(...) == 42 namespace Test func double(x: int) -> int = x * 2 func negate(x: int) -> int = 0 - x func always42() -> int = 42 // ── ILEmitterTests__Extension_LinqCount_OnList ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Extension_LinqCount_OnList topic: core status: verified // verified behavior: Test.run(...) == 3 namespace Test func run() -> int { let nums = List() nums.Add(1) nums.Add(2) nums.Add(3) return nums.Count() } // ── ILEmitterTests__ExternalCall_ConsoleWriteLine_IL ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ExternalCall_ConsoleWriteLine_IL topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func main() { Console.WriteLine("hello") } // ── ILEmitterTests__FunctionPointer_Ldftn_EmitsCorrectOpcode ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::FunctionPointer_Ldftn_EmitsCorrectOpcode topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func double(x: int) -> int { return x * 2 } func getDoublePtr() -> int { let ptr = &double return 0 } // ── ILEmitterTests__FunctionPointer_TranspilerEmitsDelegateStar ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::FunctionPointer_TranspilerEmitsDelegateStar topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func double(x: int) -> int { return x * 2 } func getPtr() -> int { let ptr = &double return 0 } // ── ILEmitterTests__GenericCall_EnumerableCountOnList ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericCall_EnumerableCountOnList topic: core status: verified // verified behavior: Test.run(...) == 2 namespace Test func run() -> int { let nums = List() nums.Add(10) nums.Add(20) return Enumerable.Count(nums) } // ── ILEmitterTests__GenericCall_InferenceStillWorks ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericCall_InferenceStillWorks topic: core status: verified // verified behavior: Test.run(...) == 6 namespace Test func run() -> int { let nums = List() nums.Add(1) nums.Add(2) nums.Add(3) return nums.Sum() } // ── ILEmitterTests__GenericConstructorCall_List_ParsesCorrectly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericConstructorCall_List_ParsesCorrectly topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func make() -> int { let items = List() return 0 } // ── ILEmitterTests__GenericExternalType_Runtime_ListAdd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericExternalType_Runtime_ListAdd topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func run() -> int { var count = 0 count = 3 return count } // ── ILEmitterTests__GenericTypeWithTupleArg_NoStackOverflow ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericTypeWithTupleArg_NoStackOverflow topic: core status: verified // verified behavior: Test.run(...) == 0 namespace Test func run() -> int { var xs = List<(int, int)>() return xs.Count } // ── ILEmitterTests__IL_Diagnostics_UnresolvedType_ReportsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::IL_Diagnostics_UnresolvedType_ReportsError topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func broken(x: Nonexistent) -> int { return 0 } // ── ILEmitterTests__Indexer_ListGetSet_RoundTrip ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Indexer_ListGetSet_RoundTrip topic: core status: verified // verified behavior: Test.run(...) == 99 namespace Test func run() -> int { let list = List() list.Add(10) list.Add(20) list.Add(30) list[1] = 99 return list[1] } // ── ILEmitterTests__LetElse_ReturnsOnNull ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::LetElse_ReturnsOnNull topic: core status: verified // verified behavior: Test.runFound(...) == "found" namespace Test func tryFind(key: string) -> string? { if key == "a" { return "found" } return nil } func run() -> string { let value = tryFind("b") else { return "default" } return value } func runFound() -> string { let value = tryFind("a") else { return "default" } return value } // ── ILEmitterTests__ListLiteral_IntElements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ListLiteral_IntElements topic: core status: verified // verified behavior: Test.first(...) == 42 namespace Test func count() -> int { let xs = [10, 20, 30] return xs.Count } func first() -> int { let xs = [42, 99] return xs[0] } // ── ILEmitterTests__ListLiteral_StringElements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ListLiteral_StringElements topic: core status: verified // verified behavior: Test.joined(...) == "hello" namespace Test func joined() -> string { let xs = ["hello", "world"] return xs[0] } // ── ILEmitterTests__MultiFile_DistinctNamespaces_CoexistInOneAssembly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::MultiFile_DistinctNamespaces_CoexistInOneAssembly topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Alpha func a() -> int { return 1 } // ── ILEmitterTests__NestedGenericWithTupleArg_NoStackOverflow ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::NestedGenericWithTupleArg_NoStackOverflow topic: core status: verified // verified behavior: Test.run(...) == 0 namespace Test func run() -> int { var xs = List<(List, List)>() return xs.Count } // ── ILEmitterTests__NoAwait_Binder_HasAwaitIsFalse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::NoAwait_Binder_HasAwaitIsFalse topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func add(a: int, b: int) -> int { return a + b } // ── ILEmitterTests__Nullable_NilReturn_ReferenceType_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Nullable_NilReturn_ReferenceType_Runtime topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func tryFind(s: string) -> string? { return nil } // ── ILEmitterTests__Nullable_NilReturn_ValueType_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Nullable_NilReturn_ValueType_Runtime topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func tryParse(s: string) -> int? { return nil } // ── ILEmitterTests__Nullable_ValueType_ResolvesToSystemNullable ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Nullable_ValueType_ResolvesToSystemNullable topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func maybe(x: int?) -> int { return 0 } // ── ILEmitterTests__NullCoalescing_StringFallback ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::NullCoalescing_StringFallback topic: core status: verified // verified behavior: Test.fallback(...) == "hello" namespace Test func fallback(s: string) -> string { return s ?? "default" } // ── ILEmitterTests__NullConditional_ChainedWithCoalescing ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::NullConditional_ChainedWithCoalescing topic: core status: verified // verified behavior: Test.safeLen(...) == 5 namespace Test func safeLen(s: string) -> int { let result = s ?? "" return result.Length } func withCoalesce(s: string) -> string { return s ?? "none" } // ── ILEmitterTests__Out_IntTryParse_Failure ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Out_IntTryParse_Failure topic: core status: verified // verified behavior: Test.run(...) == -1 namespace Test func run() -> int { if int.TryParse("not a number", out var n) { return n } return -1 } // ── ILEmitterTests__Out_IntTryParse_Success ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Out_IntTryParse_Success topic: core status: verified // verified behavior: Test.run(...) == 42 namespace Test func run() -> int { if int.TryParse("42", out var n) { return n } return -1 } // ── ILEmitterTests__Params_StringFormat_NoExtraArgs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Params_StringFormat_NoExtraArgs topic: core status: verified // verified behavior: Test.run(...) == "hello world" namespace Test func run() -> string { return string.Format("hello {0}", "world") } // ── ILEmitterTests__Params_StringFormat_TwoArgs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Params_StringFormat_TwoArgs topic: core status: verified // verified behavior: Test.run(...) == "1 + 2 = 3" namespace Test func run() -> string { return string.Format("{0} + {1} = {2}", 1, 2, 3) } // ── ILEmitterTests__Parse_ForTupleDestructuring ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_ForTupleDestructuring topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { let results = List<(int, int)>() for (a, b) in results { let x = a + b } } // ── ILEmitterTests__Parse_ImportStaticAndArrowLambda ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_ImportStaticAndArrowLambda topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T using static "System.Math" func run() -> double { return Max(1.0, ((x) => x + 2.0)(3.0)) } // ── ILEmitterTests__Parse_NullConditionalAndCoalesceInTernary ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_NullConditionalAndCoalesceInTernary topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { let s: string = nil let x = s?.Length ?? 0 let y = x > 0 ? s : "default" } // ── ILEmitterTests__Parse_TryCatchWithTypedBinding ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_TryCatchWithTypedBinding topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { try { let x = 1 } catch (Exception ex) { let msg = ex.Message } } // ── ILEmitterTests__Parse_TupleTypeInGeneric ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_TupleTypeInGeneric topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func test() -> int { var tasks = List>() return tasks.Count } // ── ILEmitterTests__Property_GetFromBclObject_ListCount ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Property_GetFromBclObject_ListCount topic: core status: verified // verified behavior: Test.run(...) == 3 namespace Test func run() -> int { let list = List() list.Add(1) list.Add(2) list.Add(3) return list.Count } // ── ILEmitterTests__Property_GetFromBclObject_StringLength ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Property_GetFromBclObject_StringLength topic: core status: verified // verified behavior: Test.run(...) == 5 namespace Test func run() -> int { let s = "hello" return s.Length } // ── ILEmitterTests__Protocol_AcrossFiles_DeclaredInA_ImplInB_UsedInC ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Protocol_AcrossFiles_DeclaredInA_ImplInB_UsedInC topic: core status: verified // verified behavior: Test.go(...) == 25 namespace Test interface IShape { func area() -> int } // ── ILEmitterTests__Protocol_EmitsInterfaceType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Protocol_EmitsInterfaceType topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IDrawable { func draw(x: int) -> string } // ── ILEmitterTests__ProtocolType_ResolvesInMethodSignature ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ProtocolType_ResolvesInMethodSignature topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IWidget { func render() -> string } func display(w: IWidget) -> int { return 0 } // ── ILEmitterTests__ShortFormOpcodes_Abs_BranchesWork ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ShortFormOpcodes_Abs_BranchesWork topic: core status: verified // verified behavior: Test.abs(...) == 0 namespace Test func abs(x: int) -> int { if x < 0 { return 0 - x } return x } // ── ILEmitterTests__ShortFormOpcodes_SumTo_ProducesCorrectResult ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ShortFormOpcodes_SumTo_ProducesCorrectResult topic: core status: verified // verified behavior: Test.sumTo(...) == 5050 namespace Test func sumTo(n: int) -> int { var total = 0 var i = 0 while i <= n { total += i i += 1 } return total } // ── ILEmitterTests__Spawn_SimpleJob_RunsAndJoinsCleanly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Spawn_SimpleJob_RunsAndJoinsCleanly topic: core status: verified // verified behavior: Test.run(...) == 7 namespace Test func run() -> int { let j = spawn { let x = 1 } j.Join() return 7 } // ── ILEmitterTests__TailCall_AccumulatorPattern ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::TailCall_AccumulatorPattern topic: core status: verified // verified behavior: Test.sumTail(...) == 50005000 namespace Test func sumTail(n: int, acc: int) -> int { if n <= 0 { return acc } return sumTail(n - 1, acc + n) } // ── ILEmitterTests__TailCall_RecursiveFunction_NoStackOverflow ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::TailCall_RecursiveFunction_NoStackOverflow topic: core status: verified // verified behavior: Test.countdown(...) == 0 namespace Test func countdown(n: int) -> int { if n <= 0 { return 0 } return countdown(n - 1) } // ── ILEmitterTests__Ternary_BasicConditional ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Ternary_BasicConditional topic: core status: verified // verified behavior: Test.pick(...) == 99 namespace Test func abs(x: int) -> int { return x >= 0 ? x : 0 - x } func pick(flag: bool) -> int { return flag ? 42 : 99 } // ── ILEmitterTests__Ternary_InExpression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Ternary_InExpression topic: core status: verified // verified behavior: Test.clamp(...) == 10 namespace Test func clamp(x: int, lo: int, hi: int) -> int { let v = x < lo ? lo : x return v > hi ? hi : v } // ── ILEmitterTests__Ternary_WithNullCoalescing ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Ternary_WithNullCoalescing topic: core status: verified // verified behavior: Test.test(...) == 5 namespace Test func test() -> int { let a = 5 > 0 ? 5 : 0 let s = nil ?? "fallback" return a } // ── ILEmitterTests__Throw_Simple_InvalidOperation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Throw_Simple_InvalidOperation topic: core status: verified // verified behavior: Test.run(...) == 99 namespace Test func run() -> int { var result = 0 try { throw InvalidOperationException("bad") } catch (Exception e) { result = 99 } return result } // ── ILEmitterTests__Try_BodyRunsWithoutException ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Try_BodyRunsWithoutException topic: core status: verified // verified behavior: Test.run(...) == 100 namespace Test func run() -> int { var result = 0 try { result = int.Parse("100") } catch (Exception e) { result = -1 } return result } // ── ILEmitterTests__Try_CatchAll_BareCatch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Try_CatchAll_BareCatch topic: core status: verified // verified behavior: Test.run(...) == 42 namespace Test func run() -> int { var result = 0 try { result = int.Parse("nope") } catch { result = 42 } return result } // ── ILEmitterTests__Try_CatchSpecificException_FormatException ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Try_CatchSpecificException_FormatException topic: core status: verified // verified behavior: Test.run(...) == -1 namespace Test func run() -> int { var result = 0 try { result = int.Parse("not a number") } catch (FormatException e) { result = -1 } return result } // ── ILEmitterTests__Tuple_ReturnAndDestructure ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Tuple_ReturnAndDestructure topic: core status: verified // verified behavior: Test.test(...) == 21 namespace Test func swap(a: int, b: int) -> (int, int) { return (b, a) } func test() -> int { let (x, y) = swap(1, 2) return x * 10 + y } // ── ILEmitterTests__Tuple_TwoElements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Tuple_TwoElements topic: core status: verified // verified behavior: Test.getFirst(...) == 42 namespace Test func pair(a: int, b: string) -> (int, string) { return (a, b) } func getFirst() -> int { let (x, y) = pair(42, "hello") return x } // ── ILEmitterTests__TupleReturn_WithListElements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::TupleReturn_WithListElements topic: core status: verified // verified behavior: Test.test(...) == 2 namespace Test func split() -> (List, List) { var nums = List() var strs = List() nums.Add(1) strs.Add("a") return (nums, strs) } func test() -> int { let (nums, strs) = split() return nums.Count + strs.Count } // ── ILEmitterTests_Coverage_Adversarial__DefiniteReturn_FallThrough_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::DefiniteReturn_FallThrough_IsError topic: core status: verified // verified behavior: reports diagnostic ES2140 namespace Test func go(n: int) -> int { if n > 0 { return 1 } } // ── ILEmitterTests_Coverage_Adversarial__DefiniteReturn_InfiniteLoopTerminates_Clean ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::DefiniteReturn_InfiniteLoopTerminates_Clean topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var i = 0 while true { i += 1 if i >= 5 { return i } } } // ── ILEmitterTests_Coverage_Adversarial__Generics_ListOfNullableInt ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_ListOfNullableInt topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = List() xs.Add(7) xs.Add(nil) return xs[0] ?? 0 } // ── ILEmitterTests_Coverage_Adversarial__Generics_NestedTuple ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_NestedTuple topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let t = (1, (2, 3)) return t.Item1 + t.Item2.Item1 + t.Item2.Item2 } // ── ILEmitterTests_Coverage_Adversarial__Generics_NullableDoubleCoalesceAndConditional ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_NullableDoubleCoalesceAndConditional topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func pick(v: double?) -> double = v ?? 1.5 func go() -> double { return pick(nil) + pick(2.5) } // ── ILEmitterTests_Coverage_Adversarial__Generics_TupleListForDestructure ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_TupleListForDestructure topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let pairs = List<(int, int)>() pairs.Add((1, 2)) pairs.Add((3, 4)) var total = 0 for (a, b) in pairs { total += a * b } return total } // ── ILEmitterTests_Coverage_Adversarial__Lexer_ExponentLargeMantissa ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Lexer_ExponentLargeMantissa topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double = 6.022e23 // ── ILEmitterTests_Coverage_Adversarial__Lexer_ExponentLowercaseE ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Lexer_ExponentLowercaseE topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double = 1.0e10 // ── ILEmitterTests_Coverage_Adversarial__Lexer_ExponentNegative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Lexer_ExponentNegative topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double = 1.5e-3 // ── ILEmitterTests_Coverage_Adversarial__Lexer_ExponentUppercaseE ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Lexer_ExponentUppercaseE topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double = 2E8 // ── ILEmitterTests_Coverage_Adversarial__Lexer_UnderscoreSeparators ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Lexer_UnderscoreSeparators topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = 1_000_000 // ── ILEmitterTests_Coverage_Choice__LetElse_Guard ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Choice.cs::LetElse_Guard topic: core status: verified // verified behavior: Test.go(...) == "ok-miss" namespace Test func find(id: int) -> string? { if id == 0 { return nil } return "ok" } func lookup(id: int) -> string { let v = find(id) else { return "miss" } return v } func go() -> string { return lookup(5) + "-" + lookup(0) } // ── ILEmitterTests_Coverage_Collections__Added_ListLiteral_Count ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListLiteral_Count topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [9, 8, 7, 6] return xs.Count } // ── ILEmitterTests_Coverage_Collections__Added_ListOfBools_Index ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfBools_Index topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { let xs = [false, true] return xs[1] } // ── ILEmitterTests_Coverage_Collections__Added_ListOfDoubles_Index ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfDoubles_Index topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { let xs = [1.5, 2.5, 3.5] return xs[1] } // ── ILEmitterTests_Coverage_Collections__Added_ListOfInts_ForInSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfInts_ForInSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4, 5] var t = 0 for x in xs { t += x } return t } // ── ILEmitterTests_Coverage_Collections__Added_ListOfInts_LastViaIndexFromEnd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfInts_LastViaIndexFromEnd topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [3, 5, 7] return xs[^1] } // ── ILEmitterTests_Coverage_Collections__Added_ListOfStrings_Concat ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfStrings_Concat topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string { let xs = ["a", "b"] return xs[0] + "," + xs[1] } // ── ILEmitterTests_Coverage_Collections__Added_NestedListOfLists ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_NestedListOfLists topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var outer = List>() var inner = List() inner.Add(1) inner.Add(2) outer.Add(inner) return outer[0].Count } // ── ILEmitterTests_Coverage_Collections__Algo_CountChar ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Algo_CountChar topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func countChar(s: string, target: char) -> int { var count = 0 for c in s { if c == target { count += 1 } } return count } func go() -> int { return countChar("banana", 'a') } // ── ILEmitterTests_Coverage_Collections__Algo_JoinWithSeparator ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Algo_JoinWithSeparator topic: core status: verified // verified behavior: Test.go(...) == "a-b-c" namespace Test func go() -> string { let xs = ["a", "b", "c"] var result = "" var first = true for x in xs { if first { result = x first = false } else { result = result + "-" + x } } return result } // ── ILEmitterTests_Coverage_Collections__Algo_ReverseString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Algo_ReverseString topic: core status: verified // verified behavior: Test.go(...) == "olleh" namespace Test func reverse(s: string) -> string { var result = "" var i = s.Length - 1 while i >= 0 { result = result + s[i].ToString() i -= 1 } return result } func go() -> string { return reverse("hello") } // ── ILEmitterTests_Coverage_Collections__Linq_Count ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Linq_Count topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4] return xs.Count() } // ── ILEmitterTests_Coverage_Collections__Linq_Max ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Linq_Max topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 30, 20] return xs.Max() } // ── ILEmitterTests_Coverage_Collections__Linq_Min ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Linq_Min topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [30, 10, 20] return xs.Min() } // ── ILEmitterTests_Coverage_Collections__Linq_Sum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Linq_Sum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4, 5] return xs.Sum() } // ── ILEmitterTests_Coverage_Collections__List_AddThenCount ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_AddThenCount topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = List() xs.Add(1) xs.Add(2) return xs.Count } // ── ILEmitterTests_Coverage_Collections__List_Contains ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_Contains topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { let xs = [1, 2, 3] return xs.Contains(2) } // ── ILEmitterTests_Coverage_Collections__List_Count ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_Count topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3] return xs.Count } // ── ILEmitterTests_Coverage_Collections__List_ForInSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_ForInSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 20, 30] var total = 0 for x in xs { total += x } return total } // ── ILEmitterTests_Coverage_Collections__List_MutateElement ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_MutateElement topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3] xs[0] = 99 return xs[0] } // ── ILEmitterTests_Coverage_Collections__List_StringElements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_StringElements topic: core status: verified // verified behavior: Test.go(...) == "b" namespace Test func go() -> string { let xs = ["a", "b", "c"] return xs[1] } // ── ILEmitterTests_Coverage_Collections__Nested_ListOfList ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Nested_ListOfList topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let outer = List>() let inner = [1, 2, 3] outer.Add(inner) return outer[0].Count } // ── ILEmitterTests_Coverage_Collections__Nullable_HasValueViaCoalesce ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Nullable_HasValueViaCoalesce topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func maybe(present: bool) -> int? { if present { return 100 } return nil } func go() -> int { let a = maybe(true) ?? 0 let b = maybe(false) ?? 0 return a + b } // ── ILEmitterTests_Coverage_Collections__Nullable_NilFallback ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Nullable_NilFallback topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> int? { if id == 0 { return nil } return 42 } func go() -> int { let v = find(0) return v ?? -1 } // ── ILEmitterTests_Coverage_Collections__Nullable_RefTypeString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Nullable_RefTypeString topic: core status: verified // verified behavior: Test.go(...) == "fallback" namespace Test func find(id: int) -> string? { if id == 0 { return nil } return "found" } func go() -> string { return find(0) ?? "fallback" } // ── ILEmitterTests_Coverage_Collections__Nullable_ValuePresent ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Nullable_ValuePresent topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> int? { if id == 0 { return nil } return 42 } func go() -> int { let v = find(1) return v ?? -1 } // ── ILEmitterTests_Coverage_Collections__RP_FuncParam_Invoke ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_FuncParam_Invoke topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func apply(f: Func, x: string) -> string = f(x) func go() -> string = apply((s) => s + "!", "hi") // ── ILEmitterTests_Coverage_Collections__RP_InterfaceInheritedMember_ReadOnlyListCount ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_InterfaceInheritedMember_ReadOnlyListCount topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var xs = List() xs.Add(1) xs.Add(2) let ro: IReadOnlyList = xs return ro.Count } // ── ILEmitterTests_Coverage_Collections__RP_OutParam_TryPattern ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_OutParam_TryPattern topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func try_thing(input: int, out result: int) -> bool { result = input + 1 return true } func go() -> int { var r = 0 if try_thing(42, out r) { return r } return -1 } // ── ILEmitterTests_Coverage_Collections__RP_StringEquals_OrdinalIgnoreCase ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_StringEquals_OrdinalIgnoreCase topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool = string.Equals("Users", "users", StringComparison.OrdinalIgnoreCase) // ── ILEmitterTests_Coverage_Collections__RP_StringJoin_OverList ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_StringJoin_OverList topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string { var built = List() built.Add("a") built.Add("b") built.Add("c") return string.Join('/', built) } // ── ILEmitterTests_Coverage_Collections__RP_StringJoin_StringSeparator_OverList ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_StringJoin_StringSeparator_OverList topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string { var xs = List() xs.Add("a") xs.Add("b") xs.Add("c") return string.Join(", ", xs) } // ── ILEmitterTests_Coverage_Collections__RP_TrimStart_Split_Count ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::RP_TrimStart_Split_Count topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let segs = "/users/42".TrimStart('/').Split('/', StringSplitOptions.RemoveEmptyEntries) return segs.Length } // ── ILEmitterTests_Coverage_Collections__String_Concatenation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Concatenation topic: core status: verified // verified behavior: Test.go(...) == "hello world" namespace Test func go() -> string { let a = "hello" let b = "world" return a + " " + b } // ── ILEmitterTests_Coverage_Collections__String_Contains ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Contains topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { return "hello world".Contains("world") } // ── ILEmitterTests_Coverage_Collections__String_EqualityComparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_EqualityComparison topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { let a = "abc" let b = "abc" return a == b } // ── ILEmitterTests_Coverage_Collections__String_IndexOf ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_IndexOf topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { return "hello world".IndexOf("world") } // ── ILEmitterTests_Coverage_Collections__String_Inequality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Inequality topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { return "abc" != "abd" } // ── ILEmitterTests_Coverage_Collections__String_Length ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Length topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { return "hello".Length } // ── ILEmitterTests_Coverage_Collections__String_Replace ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Replace topic: core status: verified // verified behavior: Test.go(...) == "hexxo" namespace Test func go() -> string { return "hello".Replace("l", "x") } // ── ILEmitterTests_Coverage_Collections__String_StartsWith ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_StartsWith topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool { return "hello".StartsWith("he") } // ── ILEmitterTests_Coverage_Collections__String_Substring ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_Substring topic: core status: verified // verified behavior: Test.go(...) == "ell" namespace Test func go() -> string { return "hello".Substring(1, 3) } // ── ILEmitterTests_Coverage_Collections__String_ToUpper ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_ToUpper topic: core status: verified // verified behavior: Test.go(...) == "HELLO" namespace Test func go() -> string { return "hello".ToUpper() } // ── ILEmitterTests_Coverage_Collections__String_TrimAndEmpty ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::String_TrimAndEmpty topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { return " ".Trim().Length } // ── ILEmitterTests_Coverage_Collections__Tuple_DestructureInFor ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Tuple_DestructureInFor topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let pairs = List<(int, int)>() pairs.Add((10, 20)) pairs.Add((30, 0)) var total = 0 for (a, b) in pairs { total += a + b } return total } // ── ILEmitterTests_Coverage_Collections__Tuple_DestructureInLet ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Tuple_DestructureInLet topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func swap(a: int, b: int) -> (int, int) { return (b, a) } func go() -> int { let (x, y) = swap(2, 1) return x } // ── ILEmitterTests_Coverage_Collections__Tuple_ReturnFromFunc ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Tuple_ReturnFromFunc topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func swap(a: int, b: int) -> (int, int) { return (b, a) } func go() -> int { let t = swap(2, 3) return t.Item1 + t.Item2 } // ── ILEmitterTests_Coverage_ControlFlow__Added_CompoundAssign_AllOps ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_CompoundAssign_AllOps topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 10 n += 4 n -= 2 n *= 1 n /= 1 return n - 5 } // ── ILEmitterTests_Coverage_ControlFlow__Added_For_AccumulateString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_For_AccumulateString topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string { var s = "" for i in 0..3 { s = s + "a" } return s } // ── ILEmitterTests_Coverage_ControlFlow__Added_For_RangeSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_For_RangeSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var t = 0 for i in 0..5 { t += i } return t } // ── ILEmitterTests_Coverage_ControlFlow__Added_If_ElseIf_Chain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_If_ElseIf_Chain topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func classify(n: int) -> int { if n < 0 { return 0 } else if n == 0 { return 1 } else { return 2 } } func go() -> int { return classify(7) } // ── ILEmitterTests_Coverage_ControlFlow__Added_NestedWhile_Product ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_NestedWhile_Product topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var t = 0 var i = 0 while i < 3 { var j = 0 while j < 4 { t += 1 j += 1 } i += 1 } return t } // ── ILEmitterTests_Coverage_ControlFlow__Added_While_DecrementToZero ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_While_DecrementToZero topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 5 while n > 0 { n -= 1 } return n } // ── ILEmitterTests_Coverage_ControlFlow__For_EarlyReturnFromLoop ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_EarlyReturnFromLoop topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func indexOf(xs: List, target: int) -> int { var i = 0 for x in xs { if x == target { return i } i += 1 } return -1 } func go() -> int { let xs = [10, 20, 30, 40] return indexOf(xs, 40) } // ── ILEmitterTests_Coverage_ControlFlow__For_Nested_Ranges ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_Nested_Ranges topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var count = 0 for i in 0..3 { for j in 0..3 { count += 1 } } return count } // ── ILEmitterTests_Coverage_ControlFlow__For_NotFoundReturnsSentinel ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_NotFoundReturnsSentinel topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func indexOf(xs: List, target: int) -> int { var i = 0 for x in xs { if x == target { return i } i += 1 } return -1 } func go() -> int { let xs = [10, 20, 30] return indexOf(xs, 99) } // ── ILEmitterTests_Coverage_ControlFlow__For_OverListLiteral ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_OverListLiteral topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var total = 0 for x in [10, 20, 30] { total += x } return total } // ── ILEmitterTests_Coverage_ControlFlow__For_OverString_CountsVowels ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_OverString_CountsVowels topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let s = "hello" var vowels = 0 for c in s { if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' { vowels += 1 } } return vowels } // ── ILEmitterTests_Coverage_ControlFlow__For_Range_Exclusive ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_Range_Exclusive topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var total = 0 for i in 0..5 { total += i } return total } // ── ILEmitterTests_Coverage_ControlFlow__For_Range_WithVariableBounds ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_Range_WithVariableBounds topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func sumRange(lo: int, hi: int) -> int { var total = 0 for i in lo..hi { total += i } return total } func go() -> int { return sumRange(3, 5) } // ── ILEmitterTests_Coverage_ControlFlow__For_RangeBuildsProduct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_RangeBuildsProduct topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var product = 1 for i in 1..6 { product *= i } return product } // ── ILEmitterTests_Coverage_ControlFlow__If_AsGuard_NoElse_FallsThrough ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::If_AsGuard_NoElse_FallsThrough topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 7 if n < 0 { n = 0 } return n } // ── ILEmitterTests_Coverage_ControlFlow__If_Else_TakesElseBranch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::If_Else_TakesElseBranch topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { if 4 < 3 { return 1 } else { return 0 } } // ── ILEmitterTests_Coverage_ControlFlow__If_Nested ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::If_Nested topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let a = 5 let b = 10 if a > 0 { if b > 0 { return 42 } } return 0 } // ── ILEmitterTests_Coverage_ControlFlow__If_ReturnsValueFromBothBranches ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::If_ReturnsValueFromBothBranches topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func pickLarger(a: int, b: int) -> int { if a > b { return a } else { return b } } func go() -> int { return pickLarger(100, 50) } // ── ILEmitterTests_Coverage_ControlFlow__If_TakesThenBranch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::If_TakesThenBranch topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { if 3 < 4 { return 1 } return 0 } // ── ILEmitterTests_Coverage_ControlFlow__IfElseIf_Chain_PicksMiddle ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::IfElseIf_Chain_PicksMiddle topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func classify(n: int) -> int { if n < 0 { return 1 } else if n == 0 { return 2 } else { return 3 } } func go() -> int { return classify(0) } // ── ILEmitterTests_Coverage_ControlFlow__LetElse_BindsOnPresent ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::LetElse_BindsOnPresent topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> int? { if id == 0 { return nil } return 5 } func go() -> int { let v = find(1) else { return -1 } return v } // ── ILEmitterTests_Coverage_ControlFlow__LetElse_TakesElseOnNil ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::LetElse_TakesElseOnNil topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> int? { if id == 0 { return nil } return 5 } func go() -> int { let v = find(0) else { return -1 } return v } // ── ILEmitterTests_Coverage_ControlFlow__Loop_AccumulateMaxValue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Loop_AccumulateMaxValue topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 40, 25, 5, 30] var best = xs[0] for x in xs { if x > best { best = x } } return best } // ── ILEmitterTests_Coverage_ControlFlow__NullCoalescing_AllNilUsesFallback ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::NullCoalescing_AllNilUsesFallback topic: core status: verified // verified behavior: Test.go(...) == "fallback" namespace Test func pick(a: string?, b: string?) -> string { return a ?? b ?? "fallback" } func go() -> string { return pick(nil, nil) } // ── ILEmitterTests_Coverage_ControlFlow__NullCoalescing_ChainPicksFirstNonNull ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::NullCoalescing_ChainPicksFirstNonNull topic: core status: verified // verified behavior: Test.go(...) == "b" namespace Test func pick(a: string?, b: string?) -> string { return a ?? b ?? "fallback" } func go() -> string { return pick(nil, "b") } // ── ILEmitterTests_Coverage_ControlFlow__NullConditional_OnPresentReadsMember ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::NullConditional_OnPresentReadsMember topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let s: string? = "hello" return s?.Length ?? 0 } // ── ILEmitterTests_Coverage_ControlFlow__Ternary_DrivesCompoundAssign ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Ternary_DrivesCompoundAssign topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 4 n += n > 0 ? 4 : -4 return n } // ── ILEmitterTests_Coverage_ControlFlow__Ternary_Nested ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Ternary_Nested topic: core status: verified // verified behavior: Test.go(...) == "zero" namespace Test func sign(n: int) -> string { return n > 0 ? "pos" : (n < 0 ? "neg" : "zero") } func go() -> string { return sign(0) } // ── ILEmitterTests_Coverage_ControlFlow__Ternary_SelectsBranch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Ternary_SelectsBranch topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let x = -9 return x > 0 ? x : 0 - x } // ── ILEmitterTests_Coverage_ControlFlow__While_AccumulatesSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_AccumulatesSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var i = 1 var total = 0 while i <= 5 { total += i i += 1 } return total } // ── ILEmitterTests_Coverage_ControlFlow__While_BuildsString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_BuildsString topic: core status: verified // verified behavior: Test.go(...) == "aaa" namespace Test func go() -> string { var s = "" var n = 3 while n > 0 { s = s + "a" n -= 1 } return s } // ── ILEmitterTests_Coverage_ControlFlow__While_Countdown ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_Countdown topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 10 while n > 0 { n -= 1 } return n } // ── ILEmitterTests_Coverage_ControlFlow__While_FalseCondition_NeverRuns ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_FalseCondition_NeverRuns topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 99 while false { n = 0 } return n } // ── ILEmitterTests_Coverage_ControlFlow__While_FlagBasedExit ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_FlagBasedExit topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func firstSquareOver(limit: int) -> int { var i = 0 var done = false var answer = -1 while !done { if i * i > limit { answer = i done = true } i += 1 } return answer } func go() -> int { return firstSquareOver(10) } // ── ILEmitterTests_Coverage_ControlFlow__While_NestedMultiplicationTable ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_NestedMultiplicationTable topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var i = 1 var sum = 0 while i <= 5 { var j = 1 while j <= 5 { sum += i * j j += 1 } i += 1 } return sum } // ── ILEmitterTests_Coverage_ControlFlow__While_TrueWithEarlyReturn ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::While_TrueWithEarlyReturn topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var n = 0 while true { n += 2 if n >= 8 { return n } } return -1 } // ── ILEmitterTests_Coverage_Data__Closure_Accumulator ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Closure_Accumulator topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var sum = 0 let addTo = func(value: int) { sum = sum + value } for i in 1..6 { addTo(i) } return sum } // ── ILEmitterTests_Coverage_Data__Closure_MutableCapture ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Closure_MutableCapture topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var total = 0 let inc = func() { total = total + 1 } inc() inc() return total } // ── ILEmitterTests_Coverage_Data__Collection_ForInSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Collection_ForInSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4, 5] var total = 0 for x in xs { total += x } return total } // ── ILEmitterTests_Coverage_Data__Collection_ListCount ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Collection_ListCount topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4] return xs.Count } // ── ILEmitterTests_Coverage_Data__Collection_ListLiteralIndex ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Collection_ListLiteralIndex topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 20, 30] return xs[0] + xs[1] + xs[2] } // ── ILEmitterTests_Coverage_Data__ExpressionBodied_Function ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::ExpressionBodied_Function topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func double(x: int) -> int = x * 2 func go() -> int { return double(10) } // ── ILEmitterTests_Coverage_Data__FunctionPointer_CallThroughLocal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::FunctionPointer_CallThroughLocal topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func add(a: int, b: int) -> int { return a + b } func go() -> int { let p = &add return p(3, 4) } // ── ILEmitterTests_Coverage_Data__Lambda_ArrowExpression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Lambda_ArrowExpression topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func apply(x: int, f: Func) -> int = f(x) func go() -> int { return apply(6, (x) => x * x) } // ── ILEmitterTests_Coverage_Data__NullCoalescing_Fallback ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::NullCoalescing_Fallback topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> string? { if id == 0 { return nil } return "x" } func go() -> int { let s = find(0) ?? "fallback" return s.Length } // ── ILEmitterTests_Coverage_Data__NullConditional_Access ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::NullConditional_Access topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let s: string? = nil return s?.Length ?? 0 } // ── ILEmitterTests_Coverage_Data__Tuple_Construction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Tuple_Construction topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let t = (3, 4) return t.Item1 + t.Item2 } // ── ILEmitterTests_Coverage_Data__Tuple_DestructuringInLet ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Tuple_DestructuringInLet topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func swap(a: int, b: int) -> (int, int) { return (b, a) } func go() -> int { let (x, y) = swap(2, 3) return x + y } // ── ILEmitterTests_Coverage_Errors__LetElse_BindsPresentValue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::LetElse_BindsPresentValue topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func lookup(id: int) -> int? { if id == 0 { return nil } return 50 } func go() -> int { let v = lookup(3) else { return -1 } return v } // ── ILEmitterTests_Coverage_Errors__LetElse_ChainedGuards ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::LetElse_ChainedGuards topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func first(id: int) -> int? { if id < 0 { return nil } return 10 } func second(n: int) -> int? { if n == 0 { return nil } return n + 5 } func go() -> int { let a = first(2) else { return -1 } let b = second(a) else { return -2 } return b } // ── ILEmitterTests_Coverage_Errors__LetElse_DivertsOnNil ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::LetElse_DivertsOnNil topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func lookup(id: int) -> int? { if id == 0 { return nil } return 50 } func go() -> int { let v = lookup(0) else { return -99 } return v } // ── ILEmitterTests_Coverage_Errors__LetElse_SecondGuardDiverts ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::LetElse_SecondGuardDiverts topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func first(id: int) -> int? { return 0 } func second(n: int) -> int? { if n == 0 { return nil } return n + 5 } func go() -> int { let a = first(2) else { return -1 } let b = second(a) else { return -2 } return b } // ── ILEmitterTests_Coverage_Errors__Throw_CaughtByCallerBoundary ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::Throw_CaughtByCallerBoundary topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func risky(n: int) -> int { if n < 0 { throw InvalidOperationException("negative") } return n } func go() -> int { var result = 0 try { result = risky(-1) } catch (Exception e) { result = -42 } return result } // ── ILEmitterTests_Coverage_Errors__TryCatch_BareCatchSwallows ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::TryCatch_BareCatchSwallows topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var result = 0 try { result = int.Parse("xyz") } catch { result = -7 } return result } // ── ILEmitterTests_Coverage_Errors__TryCatch_Nested_InnerHandlesFirst ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::TryCatch_Nested_InnerHandlesFirst topic: core status: verified // verified behavior: Test.go(...) == "inner" namespace Test func go() -> string { var tag = "none" try { try { throw FormatException("x") } catch (FormatException e) { tag = "inner" } } catch (Exception e) { tag = "outer" } return tag } // ── ILEmitterTests_Coverage_Errors__TryCatch_RecoversFromParseFailure ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::TryCatch_RecoversFromParseFailure topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var result = 0 try { result = int.Parse("notanumber") } catch (FormatException e) { result = -1 } return result } // ── ILEmitterTests_Coverage_Errors__TryCatch_SuccessPathSkipsCatch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::TryCatch_SuccessPathSkipsCatch topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var result = 0 try { result = int.Parse("123") } catch (FormatException e) { result = -1 } return result } // ── ILEmitterTests_Coverage_Errors__TryCatch_TypedCatchBindsMessage ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Errors.cs::TryCatch_TypedCatchBindsMessage topic: core status: verified // verified behavior: Test.go(...) == "negative" namespace Test func go() -> string { var msg = "none" try { throw InvalidOperationException("negative") } catch (InvalidOperationException e) { msg = e.Message } return msg } // ── ILEmitterTests_Coverage_Misc__Bcl_ListAddSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Bcl_ListAddSum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = List() xs.Add(1) xs.Add(2) xs.Add(3) var total = 0 for x in xs { total += x } return total } // ── ILEmitterTests_Coverage_Misc__Linq_Sum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Linq_Sum topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [1, 2, 3, 4] return xs.Sum() } // ── ILEmitterTests_Coverage_Misc__NullableValueLetElse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::NullableValueLetElse topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func find(id: int) -> int? { if id == 0 { return nil } return id * 10 } func lookup(id: int) -> int { let v = find(id) else { return 0 - 1 } return v } func go() -> int { return lookup(5) + lookup(0) } // ── ILEmitterTests_Coverage_Misc__OutParam_TryParse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::OutParam_TryParse topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { if int.TryParse("77", out var n) { return n } return 0 } // ── ILEmitterTests_Coverage_Misc__Pointer_ByRefIntMutation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Pointer_ByRefIntMutation topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func addTen(x: *int) { x += 10 } func go() -> int { var n = 5 addTen(&n) return n } // ── ILEmitterTests_Coverage_Misc__Range_IndexFromEnd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Range_IndexFromEnd topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 20, 30] return xs[^1] } // ── ILEmitterTests_Coverage_Misc__Range_IndexFromEnd_Second ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Range_IndexFromEnd_Second topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = [10, 20, 30] return xs[^2] } // ── ILEmitterTests_Coverage_Misc__Recursion_Factorial ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Recursion_Factorial topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func fact(n: int) -> int { if n <= 1 { return 1 } return n * fact(n - 1) } func go() -> int { return fact(5) } // ── ILEmitterTests_Coverage_Misc__Recursion_Fibonacci ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Recursion_Fibonacci topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func fib(n: int) -> int { if n < 2 { return n } return fib(n - 1) + fib(n - 2) } func go() -> int { return fib(7) } // ── ILEmitterTests_Coverage_Misc__TryCatch_ConvertsException ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::TryCatch_ConvertsException topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var result = 0 try { result = int.Parse("not a number") } catch (Exception e) { result = 0 - 1 } return result } // ── ILEmitterTests_Coverage_Misc__TryCatch_Succeeds ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::TryCatch_Succeeds topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { var result = 0 try { result = int.Parse("123") } catch { result = 0 - 1 } return result } // ── ILEmitterTests_Coverage_Numerics__Algo_CountSetViaModulo ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_CountSetViaModulo topic: core status: verified // verified behavior: Test.go(...) == 3 namespace Test func countMultiples(limit: int, of: int) -> int { var count = 0 for i in 1..limit { if i % of == 0 { count += 1 } } return count } func go() -> int { return countMultiples(10, 3) } // ── ILEmitterTests_Coverage_Numerics__Algo_FibonacciIterative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_FibonacciIterative topic: core status: verified // verified behavior: Test.go(...) == 55 namespace Test func fib(n: int) -> int { var a = 0 var b = 1 for i in 0..n { let t = a + b a = b b = t } return a } func go() -> int { return fib(10) } // ── ILEmitterTests_Coverage_Numerics__Algo_GcdEuclid ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_GcdEuclid topic: core status: verified // verified behavior: Test.go(...) == 6 namespace Test func gcd(a: int, b: int) -> int { var x = a var y = b while y != 0 { let t = y y = x % y x = t } return x } func go() -> int { return gcd(48, 18) } // ── ILEmitterTests_Coverage_Numerics__Algo_IsPrime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_IsPrime topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func isPrime(n: int) -> bool { if n < 2 { return false } var d = 2 while d * d <= n { if n % d == 0 { return false } d += 1 } return true } func go() -> bool { return isPrime(97) } // ── ILEmitterTests_Coverage_Numerics__Algo_PowerByMultiplication ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_PowerByMultiplication topic: core status: verified // verified behavior: Test.go(...) == 243 namespace Test func ipow(b: int, exp: int) -> int { var result = 1 for i in 0..exp { result *= b } return result } func go() -> int { return ipow(3, 5) } // ── ILEmitterTests_Coverage_Numerics__Algo_SumOfDigits ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Algo_SumOfDigits topic: core status: verified // verified behavior: Test.go(...) == 15 namespace Test func digitSum(n: int) -> int { var x = n var sum = 0 while x > 0 { sum += x % 10 x /= 10 } return sum } func go() -> int { return digitSum(12345) } // ── ILEmitterTests_Coverage_Numerics__Bool_AndOrNot_Keyword ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_AndOrNot_Keyword topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return (true and false) or not false } // ── ILEmitterTests_Coverage_Numerics__Bool_AndOrNot_Symbolic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_AndOrNot_Symbolic topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return (true && false) || !false } // ── ILEmitterTests_Coverage_Numerics__Bool_DeMorgan ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_DeMorgan topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func check(a: bool, b: bool) -> bool { return !(a && b) == (!a || !b) } func go() -> bool { return check(true, false) && check(true, true) && check(false, false) } // ── ILEmitterTests_Coverage_Numerics__Bool_FromComparisonChainStored ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_FromComparisonChainStored topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let n = 5 let inRange = n >= 1 && n <= 10 return inRange } // ── ILEmitterTests_Coverage_Numerics__Bool_NestedParentheses ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_NestedParentheses topic: core status: verified // verified behavior: Test.go(...) == false namespace Test func go() -> bool { return (true && (false || (true && false))) } // ── ILEmitterTests_Coverage_Numerics__Bool_XorViaNotEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Bool_XorViaNotEqual topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return (true != false) && !(true != true) } // ── ILEmitterTests_Coverage_Numerics__Byte_Identity ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Byte_Identity topic: core status: verified // verified behavior: Test.echo(...) == (byte)200 namespace Test func echo(b: byte) -> byte { return b } // ── ILEmitterTests_Coverage_Numerics__Byte_MaxValueConstant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Byte_MaxValueConstant topic: core status: verified // verified behavior: Test.go(...) == (byte)255 namespace Test func go() -> byte { return byte.MaxValue } // ── ILEmitterTests_Coverage_Numerics__Char_Equality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_Equality topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let c = 'x' return c == 'x' } // ── ILEmitterTests_Coverage_Numerics__Char_EscapeSequences ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_EscapeSequences topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let tab = '\t' let nl = '\n' return tab != nl } // ── ILEmitterTests_Coverage_Numerics__Char_FromStringIndex ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_FromStringIndex topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let s = "hello" return s[1] == 'e' } // ── ILEmitterTests_Coverage_Numerics__Char_IsDigit_BclInterop ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_IsDigit_BclInterop topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return char.IsDigit('7') } // ── ILEmitterTests_Coverage_Numerics__Char_IsLetter ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_IsLetter topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return char.IsLetter('q') } // ── ILEmitterTests_Coverage_Numerics__Char_IsWhiteSpace ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_IsWhiteSpace topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return char.IsWhiteSpace(' ') } // ── ILEmitterTests_Coverage_Numerics__Char_Ordering ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_Ordering topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return 'a' < 'b' && 'z' > 'a' } // ── ILEmitterTests_Coverage_Numerics__Char_ToUpper ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Char_ToUpper topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return char.ToUpper('a') == 'A' } // ── ILEmitterTests_Coverage_Numerics__Comparison_Operators ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Comparison_Operators topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { return 3 < 4 && 4 <= 4 && 5 > 4 && 5 >= 5 && 3 == 3 && 3 != 4 } // ── ILEmitterTests_Coverage_Numerics__Double_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_Add topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return 3.0 + 1.5 } // ── ILEmitterTests_Coverage_Numerics__Double_CompoundAssign ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_CompoundAssign topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { var x = 4.0 x *= 2.5 return x } // ── ILEmitterTests_Coverage_Numerics__Double_Division ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_Division topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return 5.0 / 2.0 } // ── ILEmitterTests_Coverage_Numerics__Double_MathAbs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_MathAbs topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return Math.Abs(0.0 - 3.5) } // ── ILEmitterTests_Coverage_Numerics__Double_MathCeiling ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_MathCeiling topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return Math.Ceiling(3.1) } // ── ILEmitterTests_Coverage_Numerics__Double_MathFloor ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_MathFloor topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return Math.Floor(3.9) } // ── ILEmitterTests_Coverage_Numerics__Double_MathPow ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_MathPow topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return Math.Pow(2.0, 3.0) } // ── ILEmitterTests_Coverage_Numerics__Double_MathSqrt ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_MathSqrt topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return Math.Sqrt(16.0) } // ── ILEmitterTests_Coverage_Numerics__Double_NegativeAndComparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_NegativeAndComparison topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let a = -2.5 let b = 1.5 return a < b && b > a } // ── ILEmitterTests_Coverage_Numerics__Double_ScientificNotation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_ScientificNotation topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return 1.0e10 } // ── ILEmitterTests_Coverage_Numerics__Double_SubtractionPrecision ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_SubtractionPrecision topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double { return 2.0 - 1.5 } // ── ILEmitterTests_Coverage_Numerics__Double_UsingStaticMath ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_UsingStaticMath topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test using static "System.Math" func go() -> double { return Sqrt(25.0) } // ── ILEmitterTests_Coverage_Numerics__Float_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Float_Add topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func add(a: float, b: float) -> float { return a + b } // ── ILEmitterTests_Coverage_Numerics__Float_Multiply ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Float_Multiply topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func mul(a: float, b: float) -> float { return a * b } // ── ILEmitterTests_Coverage_Numerics__Int_AccumulateAcrossCalls ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_AccumulateAcrossCalls topic: core status: verified // verified behavior: Test.go(...) == 6 namespace Test func bump(c: *int) { c += 1 } func go() -> int { var count = 3 bump(&count) bump(&count) bump(&count) return count } // ── ILEmitterTests_Coverage_Numerics__Int_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_Add topic: core status: verified // verified behavior: Test.add(...) == 7 namespace Test func add(a: int, b: int) -> int { return a + b } // ── ILEmitterTests_Coverage_Numerics__Int_ChainedCompoundOnParam ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_ChainedCompoundOnParam topic: core status: verified // verified behavior: Test.scale(...) == 45 namespace Test func scale(start: int, factor: int) -> int { var n = start n *= factor n += factor return n } // ── ILEmitterTests_Coverage_Numerics__Int_CompoundAssignAll ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_CompoundAssignAll topic: core status: verified // verified behavior: Test.go(...) == 13 namespace Test func go() -> int { var n = 10 n += 5 n -= 2 n *= 2 n /= 2 return n } // ── ILEmitterTests_Coverage_Numerics__Int_DoubleNegation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_DoubleNegation topic: core status: verified // verified behavior: Test.go(...) == 5 namespace Test func go() -> int { let x = 5 return 0 - (0 - x) } // ── ILEmitterTests_Coverage_Numerics__Int_LeftAssociativeDivision ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_LeftAssociativeDivision topic: core status: verified // verified behavior: Test.go(...) == 4 namespace Test func go() -> int { return 100 / 5 / 5 } // ── ILEmitterTests_Coverage_Numerics__Int_LeftAssociativeSubtraction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_LeftAssociativeSubtraction topic: core status: verified // verified behavior: Test.go(...) == -6 namespace Test func go() -> int { return 1 - 2 - 5 } // ── ILEmitterTests_Coverage_Numerics__Int_MathMax ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MathMax topic: core status: verified // verified behavior: Test.go(...) == 7 namespace Test func go() -> int { return Math.Max(3, 7) } // ── ILEmitterTests_Coverage_Numerics__Int_MathMin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MathMin topic: core status: verified // verified behavior: Test.go(...) == 3 namespace Test func go() -> int { return Math.Min(3, 7) } // ── ILEmitterTests_Coverage_Numerics__Int_MaxValueConstant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MaxValueConstant topic: core status: verified // verified behavior: Test.go(...) == int.MaxValue namespace Test func go() -> int { return int.MaxValue } // ── ILEmitterTests_Coverage_Numerics__Int_MinValueConstant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MinValueConstant topic: core status: verified // verified behavior: Test.go(...) == int.MinValue namespace Test func go() -> int { return int.MinValue } // ── ILEmitterTests_Coverage_Numerics__Int_MixedArithmeticExpression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MixedArithmeticExpression topic: core status: verified // verified behavior: Test.go(...) == 17 namespace Test func go() -> int { return 2 * 3 + 4 * 2 + 3 } // ── ILEmitterTests_Coverage_Numerics__Int_Modulo ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_Modulo topic: core status: verified // verified behavior: Test.go(...) == 1 namespace Test func go() -> int { return 7 % 3 } // ── ILEmitterTests_Coverage_Numerics__Int_ModuloZeroRemainder ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_ModuloZeroRemainder topic: core status: verified // verified behavior: Test.go(...) == 0 namespace Test func go() -> int { return 12 % 4 } // ── ILEmitterTests_Coverage_Numerics__Int_MutateThroughPointer ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_MutateThroughPointer topic: core status: verified // verified behavior: Test.go(...) == 15 namespace Test func addTo(target: *int, amount: int) { target += amount } func go() -> int { var n = 10 addTo(&n, 5) return n } // ── ILEmitterTests_Coverage_Numerics__Int_NegativeLiteral ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_NegativeLiteral topic: core status: verified // verified behavior: Test.go(...) == -5 namespace Test func go() -> int { return -5 } // ── ILEmitterTests_Coverage_Numerics__Int_NegativeModulo_FollowsClr ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_NegativeModulo_FollowsClr topic: core status: verified // verified behavior: Test.go(...) == -1 namespace Test func go() -> int { return -7 % 3 } // ── ILEmitterTests_Coverage_Numerics__Int_OverflowWrapsUnchecked ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_OverflowWrapsUnchecked topic: core status: verified // verified behavior: Test.go(...) == int.MinValue namespace Test func go() -> int { return int.MaxValue + 1 } // ── ILEmitterTests_Coverage_Numerics__Int_ParenthesizedPrecedence ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_ParenthesizedPrecedence topic: core status: verified // verified behavior: Test.go(...) == 20 namespace Test func go() -> int { return (2 + 3) * 4 } // ── ILEmitterTests_Coverage_Numerics__Int_Parse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_Parse topic: core status: verified // verified behavior: Test.go(...) == 123 namespace Test func go() -> int { return int.Parse("123") } // ── ILEmitterTests_Coverage_Numerics__Int_PowerOfTwoChain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_PowerOfTwoChain topic: core status: verified // verified behavior: Test.go(...) == 1024 namespace Test func go() -> int { var n = 1 for i in 0..10 { n *= 2 } return n } // ── ILEmitterTests_Coverage_Numerics__Int_PrecedenceMulOverAdd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_PrecedenceMulOverAdd topic: core status: verified // verified behavior: Test.go(...) == 14 namespace Test func go() -> int { return 2 + 3 * 4 } // ── ILEmitterTests_Coverage_Numerics__Int_Sub_Mul ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_Sub_Mul topic: core status: verified // verified behavior: Test.go(...) == 54 namespace Test func go() -> int { let a = 10 - 4 return a * 9 } // ── ILEmitterTests_Coverage_Numerics__Int_TruncatingDivision ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_TruncatingDivision topic: core status: verified // verified behavior: Test.go(...) == 3 namespace Test func go() -> int { return 7 / 2 } // ── ILEmitterTests_Coverage_Numerics__Int_TruncationTowardZero_Negative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_TruncationTowardZero_Negative topic: core status: verified // verified behavior: Test.go(...) == -3 namespace Test func go() -> int { return -7 / 2 } // ── ILEmitterTests_Coverage_Numerics__Int_TryParse_Failure ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_TryParse_Failure topic: core status: verified // verified behavior: Test.go(...) == -1 namespace Test func go() -> int { if int.TryParse("notnum", out var n) { return n } return -1 } // ── ILEmitterTests_Coverage_Numerics__Int_TryParse_Success ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_TryParse_Success topic: core status: verified // verified behavior: Test.go(...) == 42 namespace Test func go() -> int { if int.TryParse("42", out var n) { return n } return -1 } // ── ILEmitterTests_Coverage_Numerics__Int_UnaryMinus ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_UnaryMinus topic: core status: verified // verified behavior: Test.go(...) == -42 namespace Test func go() -> int { let x = 42 return 0 - x } // ── ILEmitterTests_Coverage_Numerics__Int_UnderscoreSeparators ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_UnderscoreSeparators topic: core status: verified // verified behavior: Test.go(...) == 1_000_000 namespace Test func go() -> int { return 1_000_000 } // ── ILEmitterTests_Coverage_Numerics__Long_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_Add topic: core status: verified // verified behavior: Test.add(...) == 7_000_000_000L namespace Test func add(a: long, b: long) -> long { return a + b } // ── ILEmitterTests_Coverage_Numerics__Long_MaxValueConstant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_MaxValueConstant topic: core status: verified // verified behavior: Test.go(...) == long.MaxValue namespace Test func go() -> long { return long.MaxValue } // ── ILEmitterTests_Coverage_Numerics__Long_Modulo ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_Modulo topic: core status: verified // verified behavior: Test.mod(...) == 2L namespace Test func mod(a: long, b: long) -> long { return a % b } // ── ILEmitterTests_Coverage_Numerics__Long_Multiply ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_Multiply topic: core status: verified // verified behavior: Test.mul(...) == 6_000_000_000L namespace Test func mul(a: long, b: long) -> long { return a * b } // ── ILEmitterTests_Coverage_Numerics__Long_Parse ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_Parse topic: core status: verified // verified behavior: Test.go(...) == 9_000_000_000L namespace Test func go() -> long { return long.Parse("9000000000") } // ── ILEmitterTests_Coverage_Numerics__Long_Subtraction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_Subtraction topic: core status: verified // verified behavior: Test.sub(...) == 1_000_000_000L namespace Test func sub(a: long, b: long) -> long { return a - b } // ── ILEmitterTests_Coverage_Numerics__Sbyte_Arithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Sbyte_Arithmetic topic: core status: verified // verified behavior: Test.add(...) == (sbyte)1 namespace Test func add(a: sbyte, b: sbyte) -> sbyte { return a + b } // ── ILEmitterTests_Coverage_Numerics__Sbyte_Negative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Sbyte_Negative topic: core status: verified // verified behavior: Test.echo(...) == (sbyte)-5 namespace Test func echo(b: sbyte) -> sbyte { return b } // ── ILEmitterTests_Coverage_Numerics__Short_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Short_Add topic: core status: verified // verified behavior: Test.add(...) == (short)7 namespace Test func add(a: short, b: short) -> short { return a + b } // ── ILEmitterTests_Coverage_Numerics__Short_Subtraction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Short_Subtraction topic: core status: verified // verified behavior: Test.sub(...) == (short)100 namespace Test func sub(a: short, b: short) -> short { return a - b } // ── ILEmitterTests_Coverage_Numerics__ShortCircuit_And_DoesNotEvaluateRight ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::ShortCircuit_And_DoesNotEvaluateRight topic: core status: verified // verified behavior: Test.go(...) == false namespace Test func go() -> bool { let d = 0 return d != 0 && (10 / d) > 0 } // ── ILEmitterTests_Coverage_Numerics__ShortCircuit_Or_DoesNotEvaluateRight ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::ShortCircuit_Or_DoesNotEvaluateRight topic: core status: verified // verified behavior: Test.go(...) == true namespace Test func go() -> bool { let d = 0 return d == 0 || (10 / d) > 0 } // ── ILEmitterTests_Coverage_Numerics__Uint_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Uint_Add topic: core status: verified // verified behavior: Test.add(...) == 7u namespace Test func add(a: uint, b: uint) -> uint { return a + b } // ── ILEmitterTests_Coverage_Numerics__Uint_MaxValueConstant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Uint_MaxValueConstant topic: core status: verified // verified behavior: Test.go(...) == uint.MaxValue namespace Test func go() -> uint { return uint.MaxValue } // ── ILEmitterTests_Coverage_Numerics__Uint_Multiply ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Uint_Multiply topic: core status: verified // verified behavior: Test.mul(...) == 12u namespace Test func mul(a: uint, b: uint) -> uint { return a * b } // ── ILEmitterTests_Coverage_Numerics__Ulong_Add ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Ulong_Add topic: core status: verified // verified behavior: Test.add(...) == 7ul namespace Test func add(a: ulong, b: ulong) -> ulong { return a + b } // ── ILEmitterTests_Coverage_Numerics__Ulong_LargeValue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Ulong_LargeValue topic: core status: verified // verified behavior: Test.echo(...) == 18_000_000_000_000_000_000UL namespace Test func echo(n: ulong) -> ulong { return n } // ── ILEmitterTests_Integration__CrossNamespace_QualifiedFreeFunctionCall ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::CrossNamespace_QualifiedFreeFunctionCall topic: core status: verified // verified behavior: Test.go(...) == 42 namespace MathNs func add(a: int, b: int) -> int { return a + b } // ── ILEmitterTests_Integration__Library_NoEntryPointEvenWithMain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Library_NoEntryPointEvenWithMain topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func main() -> int { return 5 } // ── ILEmitterTests_Interpolation__Added_LiteralBracesPassThrough ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Interpolation.cs::Added_LiteralBracesPassThrough topic: core status: verified // compiles cleanly (no auto-run claim was extracted) func go() -> string { return "{0}" } // ── ILEmitterTests_Interpolation__NegationUnaryInHole ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Interpolation.cs::NegationUnaryInHole topic: core status: verified // compiles cleanly (no auto-run claim was extracted) func go() -> string { let b = true return "not={!b}" } // ── ILEmitterTests_Interpolation__NoHolesPlainString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Interpolation.cs::NoHolesPlainString topic: core status: verified // compiles cleanly (no auto-run claim was extracted) func go() -> string = "plain" // ── ILEmitterTests_Interpolation__ParenthesizedHole ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Interpolation.cs::ParenthesizedHole topic: core status: verified // compiles cleanly (no auto-run claim was extracted) func go() -> string { let a = 3 let b = 4 return "r={(a + b) * 2}" } // ── ILEmitterTests_PtrEmbedIface__PointerEmbed_ValueReadOnly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_PtrEmbedIface.cs::PointerEmbed_ValueReadOnly topic: core status: verified // verified behavior: Test.go(...) == 40 func read(b: IBumper) -> int = b.value() // ── ILEmitterTests_PtrListRepro__ListCtor_Alone_Resolves ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_PtrListRepro.cs::ListCtor_Alone_Resolves topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let xs = List() xs.Add(5) xs.Add(10) var t = 0 for x in xs { t += x } return t } // ── ILEmitterTests_Returns__Returns_Is_Still_Valid_Identifier_Elsewhere ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Is_Still_Valid_Identifier_Elsewhere topic: core status: verified // verified behavior: Test.go(...) == 11 namespace Test func go(returns: int) -> int { return returns + 1 } // ── ILEmitterTests_Returns__Returns_Keyword_Mixed_With_Arrow_In_Same_File ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Keyword_Mixed_With_Arrow_In_Same_File topic: core status: verified // verified behavior: Test.sum(...) == 3 namespace Test func a() -> int { return 1 } func b() returns int { return 2 } func sum() returns int { return a() + b() } // ── ILEmitterTests_Returns__Returns_Keyword_Synonym_For_Arrow_TopLevel ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Keyword_Synonym_For_Arrow_TopLevel topic: core status: verified // verified behavior: Test.go(...) == 5 namespace Test func add(a: int, b: int) returns int { return a + b } func go() returns int { return add(2, 3) } // ── ILEmitterTests_Returns__Returns_Keyword_Synonym_With_Nullable_Return ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Keyword_Synonym_With_Nullable_Return topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func maybe() returns int? { return nil } // ── ILEmitterTests_Returns__Returns_Keyword_Synonym_With_String_Return ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Keyword_Synonym_With_String_Return topic: core status: verified // verified behavior: Test.greet(...) == "hi world" namespace Test func greet(name: string) returns string { return "hi " + name } // ── ILEmitterTests_Returns__Returns_Synonym_Of_Arrow_Type ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Synonym_Of_Arrow_Type topic: core status: verified // verified behavior: Test.test(...) == 42 namespace Test func test() returns int = 42 // ── ILEmitterTests_StringEquality__ChainedEquality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::ChainedEquality topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let a = "a" let b = "a" let c = "a" return a == b && b == c } // ── ILEmitterTests_StringEquality__CharComparisonNotEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::CharComparisonNotEqual topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let s = "abc" return s[0] != 'z' } // ── ILEmitterTests_StringEquality__CharComparisonStillCeq ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::CharComparisonStillCeq topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let s = "a b" return s[1] == ' ' } // ── ILEmitterTests_StringEquality__ConcatEqualsLiteral ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::ConcatEqualsLiteral topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let a = "ab" let b = "a" + "b" return a == b } // ── ILEmitterTests_StringEquality__EmptyStringEquality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::EmptyStringEquality topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let a = "" let b = "x".Substring(0, 0) return a == b } // ── ILEmitterTests_StringEquality__EqualityFeedingReturn ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::EqualityFeedingReturn topic: core status: verified // verified behavior: Test.go(...) == false func go() -> bool { let a = "abc" let b = "abd" return a == b } // ── ILEmitterTests_StringEquality__EqualityInIfCondition ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::EqualityInIfCondition topic: core status: verified // verified behavior: Test.go(...) == 1 func classify(s: string) -> int { if s == "fail" { return 1 } return 0 } func go() -> int = classify("fail") // ── ILEmitterTests_StringEquality__EqualityInIfCondition_NotTaken ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::EqualityInIfCondition_NotTaken topic: core status: verified // verified behavior: Test.go(...) == 0 func classify(s: string) -> int { if s == "fail" { return 1 } return 0 } func go() -> int = classify("ok") // ── ILEmitterTests_StringEquality__EqualityInWhileGuard ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::EqualityInWhileGuard topic: core status: verified // verified behavior: Test.go(...) == 3 func go() -> int { var n = 0 var s = "go" while s == "go" { n += 1 if n >= 3 { s = "stop" } } return n } // ── ILEmitterTests_StringEquality__NotEqual_False ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::NotEqual_False topic: core status: verified // verified behavior: Test.go(...) == false func go() -> bool { let a = "x" let b = "x" + "" return a != b } // ── ILEmitterTests_StringEquality__NotEqual_True ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::NotEqual_True topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let a = "x" let b = "y" return a != b } // ── ILEmitterTests_StringEquality__ParamEqualsLiteral_False ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::ParamEqualsLiteral_False topic: core status: verified // verified behavior: Test.go(...) == false func eq(s: string) -> bool = s == "hello" func go() -> bool = eq("world") // ── ILEmitterTests_StringEquality__ParamEqualsLiteral_True ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::ParamEqualsLiteral_True topic: core status: verified // verified behavior: Test.go(...) == true func eq(s: string) -> bool = s == "hello" func go() -> bool = eq("hello") // ── ILEmitterTests_StringEquality__SubstringEqualsLiteral ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::SubstringEqualsLiteral topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let s = "hello" let h = s.Substring(0, 3) return h == "hel" } // ── ILEmitterTests_StringEquality__TwoRuntimeStringsEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_StringEquality.cs::TwoRuntimeStringsEqual topic: core status: verified // verified behavior: Test.go(...) == true func go() -> bool { let a = "foo" + "bar" let b = "foob" + "ar" return a == b } // ── ILEmitterTests_TaskFunc__Task_Is_Still_Valid_Identifier_Elsewhere ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_TaskFunc.cs::Task_Is_Still_Valid_Identifier_Elsewhere topic: core status: verified // verified behavior: Test.go(...) == 11 namespace Test func go(task: int) -> int { return task + 1 } // ── ILEmitterTests2__Absolute_Value_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Absolute_Value_Pin topic: core status: verified // verified behavior: Test.abs(...) == 0 namespace Test func abs(n: int) -> int { if n < 0 { return -n } return n } // ── ILEmitterTests2__Block_Scoped_Let_Visible_After_Block ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Block_Scoped_Let_Visible_After_Block topic: core status: verified // verified behavior: Test.test(...) == 30 namespace Test func test() -> int { var total = 0 var i = 0 while i < 3 { let inner = i * 10 total = total + inner i = i + 1 } return total } // ── ILEmitterTests2__Both_Branches_Return_Same_Type_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Both_Branches_Return_Same_Type_Pin topic: core status: verified // verified behavior: Test.choose(...) == 200 namespace Test func choose(flag: bool) -> int { if flag { return 100 } return 200 } // ── ILEmitterTests2__Break_From_Inner_Of_Nested_Loops ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Break_From_Inner_Of_Nested_Loops topic: core status: verified // verified behavior: Test.test(...) == 6 namespace Test func test() -> int { var outer = 0 var i = 0 while i < 3 { var j = 0 while j < 10 { if j == 2 { break } outer = outer + 1 j = j + 1 } i = i + 1 } return outer } // ── ILEmitterTests2__Clamp_Idiom_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Clamp_Idiom_Pin topic: core status: verified // verified behavior: Test.clamp(...) == 7 namespace Test func clamp(n: int, lo: int, hi: int) -> int { if n < lo { return lo } if n > hi { return hi } return n } // ── ILEmitterTests2__Collatz_Length_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Collatz_Length_Pin topic: core status: verified // verified behavior: Test.collatz_steps(...) == 8 namespace Test func collatz_steps(n: int) -> int { var x = n var steps = 0 while x > 1 { if x % 2 == 0 { x = x / 2 } else { x = x * 3 + 1 } steps = steps + 1 } return steps } // ── ILEmitterTests2__Comparison_All_Operators ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Comparison_All_Operators topic: core status: verified // verified behavior: Test.test(...) == 101010 namespace Test func test(a: int, b: int) -> int { var result = 0 if a == b { result = result + 1 } if a != b { result = result + 10 } if a < b { result = result + 100 } if a > b { result = result + 1000 } if a <= b { result = result + 10000 } if a >= b { result = result + 100000 } return result } // ── ILEmitterTests2__Conditional_Chain_With_StringConcat_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Conditional_Chain_With_StringConcat_Pin topic: core status: verified // verified behavior: Test.describe(...) == "grade: F" namespace Test func describe(score: int) -> string { var label = "" if score >= 90 { label = "A" } if score >= 80 && score < 90 { label = "B" } if score >= 70 && score < 80 { label = "C" } if score < 70 { label = "F" } return "grade: " + label } // ── ILEmitterTests2__Continue_From_Inner_Of_Nested_Loops ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Continue_From_Inner_Of_Nested_Loops topic: core status: verified // verified behavior: Test.test(...) == 9 namespace Test func test() -> int { var total = 0 var i = 0 while i < 3 { var j = 0 while j < 4 { j = j + 1 if j == 2 { continue } total = total + 1 } i = i + 1 } return total } // ── ILEmitterTests2__Count_Set_Bits_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Count_Set_Bits_Pin topic: core status: verified // verified behavior: Test.popcount(...) == 1 namespace Test func popcount(n: int) -> int { var count = 0 var x = n while x > 0 { if x % 2 == 1 { count = count + 1 } x = x / 2 } return count } // ── ILEmitterTests2__Defer_LIFO_Ordering ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Defer_LIFO_Ordering topic: core status: verified // verified behavior: Test.test(...) == "X" namespace Test func test() -> string { var s = "" defer { s = s + "C" } defer { s = s + "B" } defer { s = s + "A" } s = s + "X" return s } // ── ILEmitterTests2__Defer_Runs_On_Early_Return ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Defer_Runs_On_Early_Return topic: core status: verified // verified behavior: Test.test(...) == ".early" namespace Test func test() -> string { var trace = "" defer { trace = trace + "D" } if true { return trace + ".early" } return trace } // ── ILEmitterTests2__DigitSum_Via_While_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::DigitSum_Via_While_Pin topic: core status: verified // verified behavior: Test.digit_sum(...) == 1 namespace Test func digit_sum(n: int) -> int { var total = 0 var x = n while x > 0 { total = total + x % 10 x = x / 10 } return total } // ── ILEmitterTests2__Factorial_Recursive_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Factorial_Recursive_Pin topic: core status: verified // verified behavior: Test.fact(...) == 3628800 namespace Test func fact(n: int) -> int { if n <= 1 { return 1 } return n * fact(n - 1) } // ── ILEmitterTests2__Fibonacci_Iterative_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Fibonacci_Iterative_Pin topic: core status: verified // verified behavior: Test.fib(...) == 6765 namespace Test func fib(n: int) -> int { if n < 2 { return n } var a = 0 var b = 1 var i = 2 while i <= n { let next = a + b a = b b = next i = i + 1 } return b } // ── ILEmitterTests2__Fibonacci_Recursive_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Fibonacci_Recursive_Pin topic: core status: verified // verified behavior: Test.fib(...) == 55 namespace Test func fib(n: int) -> int { if n < 2 { return n } return fib(n - 1) + fib(n - 2) } // ── ILEmitterTests2__Float_Add_Double ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Float_Add_Double topic: core status: verified // verified behavior: Test.test(...) == 3.5 namespace Test func test(a: double, b: double) -> double = a + b // ── ILEmitterTests2__Float_Div_Double ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Float_Div_Double topic: core status: verified // verified behavior: Test.test(...) == 2.5 namespace Test func test(a: double, b: double) -> double = a / b // ── ILEmitterTests2__Float_Mul_Double ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Float_Mul_Double topic: core status: verified // verified behavior: Test.test(...) == 6.0 namespace Test func test(a: double, b: double) -> double = a * b // ── ILEmitterTests2__Float_Sub_Double ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Float_Sub_Double topic: core status: verified // verified behavior: Test.test(...) == 0.75 namespace Test func test(a: double, b: double) -> double = a - b // ── ILEmitterTests2__Function_Literal_Captures_Let ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Function_Literal_Captures_Let topic: core status: verified // verified behavior: Test.test(...) == 10 namespace Test func test() -> int { let x = 10 let read = func() -> int = x return read() } // ── ILEmitterTests2__Function_Multiple_Returns_Via_If_Else ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Function_Multiple_Returns_Via_If_Else topic: core status: verified // verified behavior: Test.sign(...) == 0 namespace Test func sign(n: int) -> int { if n > 0 { return 1 } if n < 0 { return -1 } return 0 } // ── ILEmitterTests2__Function_Returning_Bool_From_Comparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Function_Returning_Bool_From_Comparison topic: core status: verified // verified behavior: Test.is_even(...) == true namespace Test func is_even(n: int) -> bool = n % 2 == 0 // ── ILEmitterTests2__GCD_Euclidean_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::GCD_Euclidean_Pin topic: core status: verified // verified behavior: Test.gcd(...) == 7 namespace Test func gcd(a: int, b: int) -> int { var x = a var y = b while y != 0 { let t = y y = x % y x = t } return x } // ── ILEmitterTests2__Helper_Function_Side_Effects_Through_Return_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Helper_Function_Side_Effects_Through_Return_Pin topic: core status: verified // verified behavior: Test.sum_squares(...) == 385 namespace Test func square(n: int) -> int = n * n func sum_squares(n: int) -> int { var total = 0 var i = 1 while i <= n { total = total + square(i) i = i + 1 } return total } // ── ILEmitterTests2__If_As_Statement_Returns_From_Branch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::If_As_Statement_Returns_From_Branch topic: core status: verified // verified behavior: Test.test(...) == "zero" namespace Test func test(n: int) -> string { if n > 0 { return "positive" } if n < 0 { return "negative" } return "zero" } // ── ILEmitterTests2__If_Mutates_Outer_Var ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::If_Mutates_Outer_Var topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test(n: int) -> int { var result = 0 if n > 0 { result = 1 } if n < 0 { result = -1 } return result } // ── ILEmitterTests2__IntegerSquareRoot_BinarySearch_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::IntegerSquareRoot_BinarySearch_Pin topic: core status: verified // verified behavior: Test.isqrt(...) == 31 namespace Test func isqrt(n: int) -> int { if n < 2 { return n } var lo = 0 var hi = n while lo < hi { let mid = (lo + hi + 1) / 2 if mid * mid <= n { lo = mid } if mid * mid > n { hi = mid - 1 } } return lo } // ── ILEmitterTests2__IsPrime_Trial_Division_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::IsPrime_Trial_Division_Pin topic: core status: verified // verified behavior: Test.is_prime(...) == true namespace Test func is_prime(n: int) -> bool { if n < 2 { return false } if n == 2 { return true } if n % 2 == 0 { return false } var d = 3 while d * d <= n { if n % d == 0 { return false } d = d + 2 } return true } // ── ILEmitterTests2__Logical_And_Both_True ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Logical_And_Both_True topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: bool, b: bool) -> bool = a && b // ── ILEmitterTests2__Logical_Or_Truth_Table ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Logical_Or_Truth_Table topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: bool, b: bool) -> bool = a || b // ── ILEmitterTests2__Min_Max_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Min_Max_Pin topic: core status: verified // verified behavior: Test.minimum(...) == 5 namespace Test func minimum(a: int, b: int) -> int { if a < b { return a } return b } func maximum(a: int, b: int) -> int { if a > b { return a } return b } // ── ILEmitterTests2__Modulo_Zero_Result ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Modulo_Zero_Result topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test(a: int, b: int) -> int = a % b // ── ILEmitterTests2__Multiply_Without_Star_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Multiply_Without_Star_Pin topic: core status: verified // verified behavior: Test.mul(...) == 0 namespace Test func mul(a: int, b: int) -> int { var result = 0 var i = 0 while i < b { result = result + a i = i + 1 } return result } // ── ILEmitterTests2__Negative_Literal_As_Initializer ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Negative_Literal_As_Initializer topic: core status: verified // verified behavior: Test.test(...) == -42 namespace Test func test() -> int { let n = -42 return n } // ── ILEmitterTests2__Negative_Literal_Comparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Negative_Literal_Comparison topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(n: int) -> bool = n < -10 // ── ILEmitterTests2__Power_Of_Two_Via_While_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Power_Of_Two_Via_While_Pin topic: core status: verified // verified behavior: Test.pow2(...) == 65536 namespace Test func pow2(n: int) -> int { var result = 1 var i = 0 while i < n { result = result * 2 i = i + 1 } return result } // ── ILEmitterTests2__Range_Check_With_And ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Range_Check_With_And topic: core status: verified // verified behavior: Test.in_range(...) == false namespace Test func in_range(n: int) -> bool = n >= 0 && n <= 100 // ── ILEmitterTests2__Recursive_Mutual_Functions_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Recursive_Mutual_Functions_Pin topic: core status: verified // verified behavior: Test.is_odd(...) == false namespace Test func is_even(n: int) -> bool { if n == 0 { return true } return is_odd(n - 1) } func is_odd(n: int) -> bool { if n == 0 { return false } return is_even(n - 1) } // ── ILEmitterTests2__Reverse_Digits_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Reverse_Digits_Pin topic: core status: verified // verified behavior: Test.reverse(...) == 0 namespace Test func reverse(n: int) -> int { var result = 0 var x = n while x > 0 { result = result * 10 + x % 10 x = x / 10 } return result } // ── ILEmitterTests2__String_Concat_With_Int_Via_ToString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::String_Concat_With_Int_Via_ToString topic: core status: verified // verified behavior: Test.test(...) == "count=42" namespace Test func test(label: string, n: int) -> string = label + n.ToString() // ── ILEmitterTests2__String_Concat_With_Plus ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::String_Concat_With_Plus topic: core status: verified // verified behavior: Test.test(...) == "hello world" namespace Test func test(a: string, b: string) -> string = a + b // ── ILEmitterTests2__String_Equality_Same_Content ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::String_Equality_Same_Content topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: string, b: string) -> bool = a == b // ── ILEmitterTests2__String_Length_Property ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::String_Length_Property topic: core status: verified // verified behavior: Test.test(...) == 11 namespace Test func test(s: string) -> int = s.Length // ── ILEmitterTests2__Tuple_Construction_And_Field_Access ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Tuple_Construction_And_Field_Access topic: core status: verified // verified behavior: Test.test(...) == 42 namespace Test func make() -> (int, string) = (42, "hi") func test() -> int { let t = make() return t.Item1 } // ── ILEmitterTests2__Tuple_String_Element_Access ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Tuple_String_Element_Access topic: core status: verified // verified behavior: Test.test(...) == "hi" namespace Test func make() -> (int, string) = (42, "hi") func test() -> string { let t = make() return t.Item2 } // ── ILEmitterTests2__Tuple_Three_Element ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Tuple_Three_Element topic: core status: verified // verified behavior: Test.test(...) == 6 namespace Test func make() -> (int, int, int) = (1, 2, 3) func test() -> int { let t = make() return t.Item1 + t.Item2 + t.Item3 } // ── ILEmitterTests2__While_Equal_Endpoints_Empty_Execution ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::While_Equal_Endpoints_Empty_Execution topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test() -> int { var count = 0 var i = 5 while i < 5 { count = count + 1 i = i + 1 } return count } // ── ILEmitterTests2__While_False_Initial_Empty_Execution ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::While_False_Initial_Empty_Execution topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test() -> int { var count = 0 var i = 10 while i < 0 { count = count + 1 i = i + 1 } return count } // ── ILEmitterTests2__While_Sum_To_N_Idiom ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::While_Sum_To_N_Idiom topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test(n: int) -> int { var total = 0 var i = 1 while i <= n { total = total + i i = i + 1 } return total } // ── ILEmitterTests3__Ackermann_Small_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Ackermann_Small_Pin topic: core status: verified // verified behavior: Test.ack(...) == 7 namespace Test func ack(m: int, n: int) -> int { if m == 0 { return n + 1 } if n == 0 { return ack(m - 1, 1) } return ack(m - 1, ack(m, n - 1)) } // ── ILEmitterTests3__Average_Of_Three ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Average_Of_Three topic: core status: verified // verified behavior: Test.avg(...) == 10 namespace Test func avg(a: int, b: int, c: int) -> int = (a + b + c) / 3 // ── ILEmitterTests3__Binary_Search_Returns_Position ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Binary_Search_Returns_Position topic: core status: verified // verified behavior: Test.find_in_sorted(...) == -1 namespace Test func find_in_sorted(target: int, n: int) -> int { var lo = 0 var hi = n while lo < hi { let mid = (lo + hi) / 2 if mid == target { return mid } if mid < target { lo = mid + 1 } if mid > target { hi = mid } } return -1 } // ── ILEmitterTests3__Bool_Returned_From_Function_Used_In_If ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Bool_Returned_From_Function_Used_In_If topic: core status: verified // verified behavior: Test.test(...) == "not pos" namespace Test func is_positive(n: int) -> bool = n > 0 func test(n: int) -> string { if is_positive(n) { return "pos" } return "not pos" } // ── ILEmitterTests3__Closure_Accumulator_In_Loop ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Closure_Accumulator_In_Loop topic: core status: verified // verified behavior: Test.test(...) == 15 namespace Test func test() -> int { var sum = 0 let add = func(x: int) { sum = sum + x } for i in 1..6 { add(i) } return sum } // ── ILEmitterTests3__Closure_Captures_Let_For_Read ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Closure_Captures_Let_For_Read topic: core status: verified // verified behavior: Test.test(...) == 220 namespace Test func test() -> int { let base_val = 100 let with_base = func(x: int) -> int = base_val + x return with_base(5) + with_base(15) } // ── ILEmitterTests3__Closure_Captures_Var_For_Mutation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Closure_Captures_Var_For_Mutation topic: core status: verified // verified behavior: Test.test(...) == 3 namespace Test func test() -> int { var total = 0 let inc = func() { total = total + 1 } inc() inc() inc() return total } // ── ILEmitterTests3__Comparison_Result_Of_Arithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Comparison_Result_Of_Arithmetic topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: int, b: int) -> bool = a * 2 > b + 5 // ── ILEmitterTests3__Compound_Assign_Div_Eq ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Assign_Div_Eq topic: core status: verified // verified behavior: Test.test(...) == 25 namespace Test func test() -> int { var x = 100 x /= 4 return x } // ── ILEmitterTests3__Compound_Assign_In_Loop_Sum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Assign_In_Loop_Sum topic: core status: verified // verified behavior: Test.test(...) == 55 namespace Test func test(n: int) -> int { var total = 0 var i = 0 while i < n { total += i + 1 i += 1 } return total } // ── ILEmitterTests3__Compound_Assign_Minus_Eq ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Assign_Minus_Eq topic: core status: verified // verified behavior: Test.test(...) == 70 namespace Test func test() -> int { var x = 100 x -= 30 return x } // ── ILEmitterTests3__Compound_Assign_Mul_Eq ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Assign_Mul_Eq topic: core status: verified // verified behavior: Test.test(...) == 12 namespace Test func test() -> int { var x = 3 x *= 4 return x } // ── ILEmitterTests3__Compound_Assign_Plus_Eq ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Assign_Plus_Eq topic: core status: verified // verified behavior: Test.test(...) == 18 namespace Test func test() -> int { var x = 10 x += 5 x += 3 return x } // ── ILEmitterTests3__Compound_Conditions_In_While ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Compound_Conditions_In_While topic: core status: verified // verified behavior: Test.test(...) == 10 namespace Test func test() -> int { var i = 0 var count = 0 while i < 10 && count < 5 { i = i + 1 if i % 2 == 0 { count = count + 1 } } return i } // ── ILEmitterTests3__Count_Digits_Iterative ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Count_Digits_Iterative topic: core status: verified // verified behavior: Test.count_digits(...) == 6 namespace Test func count_digits(n: int) -> int { if n == 0 { return 1 } var x = n var count = 0 while x > 0 { count = count + 1 x = x / 10 } return count } // ── ILEmitterTests3__Defer_Single_Block_Runs_On_Exit ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Defer_Single_Block_Runs_On_Exit topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func test() -> int { var x = 0 defer { x = 1 } return x } // ── ILEmitterTests3__Early_Exit_With_Break ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Early_Exit_With_Break topic: core status: verified // verified behavior: Test.first_above(...) == 101 namespace Test func first_above(threshold: int) -> int { var i = 0 while i < 1000 { if i > threshold { break } i = i + 1 } return i } // ── ILEmitterTests3__Else_If_Chain_Five_Way ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Else_If_Chain_Five_Way topic: core status: verified // verified behavior: Test.grade(...) == "F" namespace Test func grade(s: int) -> string { if s >= 90 { return "A" } else if s >= 80 { return "B" } else if s >= 70 { return "C" } else if s >= 60 { return "D" } else { return "F" } } // ── ILEmitterTests3__Else_If_Chain_Three_Way ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Else_If_Chain_Three_Way topic: core status: verified // verified behavior: Test.test(...) == "zero" namespace Test func test(x: int) -> string { if x > 0 { return "pos" } else if x < 0 { return "neg" } else { return "zero" } } // ── ILEmitterTests3__Float_Division_Real ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Float_Division_Real topic: core status: verified // verified behavior: Test.test(...) == 3.5 namespace Test func test() -> double = 7.0 / 2.0 // ── ILEmitterTests3__For_In_Range_Counts_Iterations ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::For_In_Range_Counts_Iterations topic: core status: verified // verified behavior: Test.test(...) == 100 namespace Test func test(n: int) -> int { var count = 0 for i in 0..n { count = count + 1 } return count } // ── ILEmitterTests3__For_In_Range_Starting_At_Nonzero ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::For_In_Range_Starting_At_Nonzero topic: core status: verified // verified behavior: Test.test(...) == 35 namespace Test func test() -> int { var total = 0 for i in 5..10 { total = total + i } return total } // ── ILEmitterTests3__For_In_Range_Sums_To_N ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::For_In_Range_Sums_To_N topic: core status: verified // verified behavior: Test.test(...) == 45 namespace Test func test(n: int) -> int { var total = 0 for i in 0..n { total = total + i } return total } // ── ILEmitterTests3__For_Range_Single_Iteration ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::For_Range_Single_Iteration topic: core status: verified // verified behavior: Test.test(...) == 5 namespace Test func test() -> int { var sum = 0 for i in 5..6 { sum = sum + i } return sum } // ── ILEmitterTests3__Function_Call_Inside_Expression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_Call_Inside_Expression topic: core status: verified // verified behavior: Test.test(...) == 25 namespace Test func sq(x: int) -> int = x * x func test() -> int { return sq(3) + sq(4) } // ── ILEmitterTests3__Function_Composition_Manual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_Composition_Manual topic: core status: verified // verified behavior: Test.test(...) == 42 namespace Test func double_it(x: int) -> int = x * 2 func increment(x: int) -> int = x + 1 func test() -> int { return double_it(increment(20)) } // ── ILEmitterTests3__Function_Mixed_Param_Types ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_Mixed_Param_Types topic: core status: verified // verified behavior: Test.test(...) == "foo" namespace Test func test(a: int, b: bool, c: string) -> string { if b { return c + ":" + a.ToString() } return c } // ── ILEmitterTests3__Function_Tail_Recursive_Style ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_Tail_Recursive_Style topic: core status: verified // verified behavior: Test.test(...) == 5050 namespace Test func sum_to(n: int, acc: int) -> int { if n == 0 { return acc } return sum_to(n - 1, acc + n) } func test() -> int = sum_to(100, 0) // ── ILEmitterTests3__Function_With_Six_Params ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_With_Six_Params topic: core status: verified // verified behavior: Test.test(...) == 21 namespace Test func test(a: int, b: int, c: int, d: int, e: int, f: int) -> int = a + b + c + d + e + f // ── ILEmitterTests3__If_Else_Returning_String ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_Else_Returning_String topic: core status: verified // verified behavior: Test.test(...) == "negative" namespace Test func test(n: int) -> string { if n == 0 { return "zero" } else if n > 0 { return "positive" } else { return "negative" } } // ── ILEmitterTests3__If_Nested_Inside_If ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_Nested_Inside_If topic: core status: verified // verified behavior: Test.test(...) == 3 namespace Test func test(a: int, b: int) -> int { if a > 0 { if b > 0 { return 1 } return 2 } return 3 } // ── ILEmitterTests3__If_No_Else_Falls_Through_Cleanly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_No_Else_Falls_Through_Cleanly topic: core status: verified // verified behavior: Test.test(...) == 10 namespace Test func test(flag: bool) -> int { var x = 10 if flag { x = 100 } return x } // ── ILEmitterTests3__If_With_Compound_Condition_And ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_With_Compound_Condition_And topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: int, b: int) -> bool { if a > 0 && b > 0 { return true } return false } // ── ILEmitterTests3__If_With_Compound_Condition_Or ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_With_Compound_Condition_Or topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(a: int, b: int) -> bool { if a > 0 || b > 0 { return true } return false } // ── ILEmitterTests3__If_With_Not_Operator ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::If_With_Not_Operator topic: core status: verified // verified behavior: Test.test(...) == 1 namespace Test func test(b: bool) -> int { if !b { return 1 } return 0 } // ── ILEmitterTests3__IfElse_Picks_Else_Branch ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::IfElse_Picks_Else_Branch topic: core status: verified // verified behavior: Test.test(...) == -1 namespace Test func test(x: int) -> int { if x > 0 { return 1 } else { return -1 } } // ── ILEmitterTests3__Int_Division_Truncates ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Int_Division_Truncates topic: core status: verified // verified behavior: Test.test(...) == 3 namespace Test func test() -> int = 7 / 2 // ── ILEmitterTests3__Int_Max_Plus_One_Overflows ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Int_Max_Plus_One_Overflows topic: core status: verified // verified behavior: Test.test(...) == -2147483648 namespace Test func test() -> int { let max = 2147483647 return max + 1 } // ── ILEmitterTests3__Linear_Search_Idiom ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Linear_Search_Idiom topic: core status: verified // verified behavior: Test.contains(...) == true namespace Test func contains(target: int, lo: int, hi: int) -> bool { var i = lo while i < hi { if i == target { return true } i = i + 1 } return false } // ── ILEmitterTests3__Long_Loop_Counts_To_1000 ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Long_Loop_Counts_To_1000 topic: core status: verified // verified behavior: Test.test(...) == 1000 namespace Test func test() -> int { var i = 0 var count = 0 while i < 1000 { count = count + 1 i = i + 1 } return count } // ── ILEmitterTests3__Max_Of_Three_Values ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Max_Of_Three_Values topic: core status: verified // verified behavior: Test.max3(...) == 9 namespace Test func max3(a: int, b: int, c: int) -> int { var m = a if b > m { m = b } if c > m { m = c } return m } // ── ILEmitterTests3__Min_Of_Three_Values ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Min_Of_Three_Values topic: core status: verified // verified behavior: Test.min3(...) == 2 namespace Test func min3(a: int, b: int, c: int) -> int { var m = a if b < m { m = b } if c < m { m = c } return m } // ── ILEmitterTests3__Nested_For_In_Range_Sum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Nested_For_In_Range_Sum topic: core status: verified // verified behavior: Test.test(...) == 36 namespace Test func test() -> int { var total = 0 for i in 1..4 { for j in 1..4 { total = total + i * j } } return total } // ── ILEmitterTests3__Nested_Function_Calls_Three_Deep ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Nested_Function_Calls_Three_Deep topic: core status: verified // verified behavior: Test.test(...) == 19 namespace Test func a(x: int) -> int = x + 1 func b(x: int) -> int = a(x) * 2 func c(x: int) -> int = b(x) - 3 func test() -> int = c(10) // ── ILEmitterTests3__Nested_While_Sum_Multiplication_Table ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Nested_While_Sum_Multiplication_Table topic: core status: verified // verified behavior: Test.test(...) == 36 namespace Test func test() -> int { var total = 0 var i = 1 while i <= 3 { var j = 1 while j <= 3 { total = total + i * j j = j + 1 } i = i + 1 } return total } // ── ILEmitterTests3__Parity_Check ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Parity_Check topic: core status: verified // verified behavior: Test.parity(...) == "even" namespace Test func parity(n: int) -> string { if n % 2 == 0 { return "even" } return "odd" } // ── ILEmitterTests3__Power_Recursive ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Power_Recursive topic: core status: verified // verified behavior: Test.pow(...) == 125 namespace Test func pow(base: int, exp: int) -> int { if exp == 0 { return 1 } return base * pow(base, exp - 1) } // ── ILEmitterTests3__Product_Of_Range ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Product_Of_Range topic: core status: verified // verified behavior: Test.product(...) == 720 namespace Test func product(lo: int, hi: int) -> int { var p = 1 for i in lo..hi { p = p * i } return p } // ── ILEmitterTests3__Range_Of_Squares ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Range_Of_Squares topic: core status: verified // verified behavior: Test.test(...) == 285 namespace Test func test(n: int) -> int { var sum = 0 for i in 1..n { sum = sum + i * i } return sum } // ── ILEmitterTests3__Recursion_Sum_Down_To_Zero ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Recursion_Sum_Down_To_Zero topic: core status: verified // verified behavior: Test.sum_down(...) == 5050 namespace Test func sum_down(n: int) -> int { if n == 0 { return 0 } return n + sum_down(n - 1) } // ── ILEmitterTests3__Reverse_Digits_Recursive_Helper_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Reverse_Digits_Recursive_Helper_Pin topic: core status: verified // verified behavior: Test.rev(...) == 0 namespace Test func rev_helper(n: int, acc: int) -> int { if n == 0 { return acc } return rev_helper(n / 10, acc * 10 + n % 10) } func rev(n: int) -> int = rev_helper(n, 0) // ── ILEmitterTests3__Skip_Logic_With_Continue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Skip_Logic_With_Continue topic: core status: verified // verified behavior: Test.test(...) == 18 namespace Test func test() -> int { var collected = 0 var i = 0 while i < 20 { i = i + 1 if i == 7 { continue } if i == 13 { continue } collected = collected + 1 } return collected } // ── ILEmitterTests3__String_Empty_Length_Zero ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::String_Empty_Length_Zero topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func test() -> int = "".Length // ── ILEmitterTests3__String_Length_Comparison ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::String_Length_Comparison topic: core status: verified // verified behavior: Test.test(...) == false namespace Test func test(s: string) -> bool = s.Length > 3 // ── ILEmitterTests3__Sum_Even_Numbers_Below_N ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Sum_Even_Numbers_Below_N topic: core status: verified // verified behavior: Test.test(...) == 2450 namespace Test func test(n: int) -> int { var total = 0 for i in 0..n { if i % 2 == 0 { total = total + i } } return total } // ── ILEmitterTests3__Sum_From_1_To_100 ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Sum_From_1_To_100 topic: core status: verified // verified behavior: Test.test(...) == 5050 namespace Test func test() -> int { var total = 0 for i in 1..101 { total = total + i } return total } // ── ILEmitterTests3__Sum_Of_Digits_Recursive ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Sum_Of_Digits_Recursive topic: core status: verified // verified behavior: Test.dsum(...) == 45 namespace Test func dsum(n: int) -> int { if n == 0 { return 0 } return n % 10 + dsum(n / 10) } // ── ILEmitterTests3__Swap_Pattern_With_Temp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Swap_Pattern_With_Temp topic: core status: verified // verified behavior: Test.test(...) == 2010 namespace Test func test() -> int { var a = 10 var b = 20 let tmp = a a = b b = tmp return a * 100 + b } // ── ILEmitterTests3__Ternary_Basic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Ternary_Basic topic: core status: verified // verified behavior: Test.test(...) == "neg" namespace Test func test(x: int) -> string = x > 0 ? "pos" : "neg" // ── ILEmitterTests3__Ternary_Nested ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Ternary_Nested topic: core status: verified // verified behavior: Test.sign(...) == 0 namespace Test func sign(n: int) -> int = n > 0 ? 1 : n < 0 ? -1 : 0 // ── ILEmitterTests3__Ternary_With_Int_Return ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Ternary_With_Int_Return topic: core status: verified // verified behavior: Test.abs(...) == 7 namespace Test func abs(n: int) -> int = n > 0 ? n : 0 - n // ── ILEmitterTests3__Triangle_Number ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Triangle_Number topic: core status: verified // verified behavior: Test.tri(...) == 5050 namespace Test func tri(n: int) -> int = n * (n + 1) / 2 // ── ILEmitterTests3__Tuple_Let_Destructure_Three_Element ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Tuple_Let_Destructure_Three_Element topic: core status: verified // verified behavior: Test.test(...) == 321 namespace Test func triple() -> (int, int, int) = (1, 2, 3) func test() -> int { let (a, b, c) = triple() return a + b * 10 + c * 100 } // ── ILEmitterTests3__Tuple_Let_Destructure_Two_Element ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Tuple_Let_Destructure_Two_Element topic: core status: verified // verified behavior: Test.test(...) == 73 namespace Test func swap(a: int, b: int) -> (int, int) = (b, a) func test() -> int { let (x, y) = swap(3, 7) return x * 10 + y } // ── ILEmitterTests3__Tuple_Mixed_Types ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Tuple_Mixed_Types topic: core status: verified // verified behavior: Test.test(...) == "yes:42" namespace Test func mixed() -> (int, string, bool) = (42, "yes", true) func test() -> string { let (n, s, b) = mixed() return s + ":" + n.ToString() } // ── ILEmitterTests3__Variable_Read_In_Inner_Block ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Variable_Read_In_Inner_Block topic: core status: verified // verified behavior: Test.test(...) == 100 namespace Test func test() -> int { let outer = 100 var x = 0 if outer > 50 { x = outer } return x } // ── ILEmitterTests3__Void_Returning_Function_Compiles_And_Runs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Void_Returning_Function_Compiles_And_Runs topic: core status: verified // verified behavior: Test.test(...) == 0 namespace Test func noop() { let x = 1 } func test() -> int { noop() return 0 } // ── ILEmitterTests3__While_With_Break_Exits_Early ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::While_With_Break_Exits_Early topic: core status: verified // verified behavior: Test.test(...) == 5 namespace Test func test() -> int { var i = 0 while true { if i >= 5 { break } i = i + 1 } return i } // ── ILEmitterTests3__While_With_Continue_Skips_Iteration ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::While_With_Continue_Skips_Iteration topic: core status: verified // verified behavior: Test.test(...) == 25 namespace Test func test() -> int { var sum = 0 var i = 0 while i < 10 { i = i + 1 if i % 2 == 0 { continue } sum = sum + i } return sum } // ── MixedLanguageTests__CSharp_Instance_Method_Called_From_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Instance_Method_Called_From_Esharp topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func describe(g: Greeter) -> string = g.Hello("world") // ── MixedLanguageTests__CSharp_Static_Method_Called_From_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Static_Method_Called_From_Esharp topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func double_it(x: int) -> int = MathHelper.Twice(x) // ── MixedLanguageTests__Esharp_Func_Called_From_Csharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::Esharp_Func_Called_From_Csharp topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func triple(n: int) -> int = n * 3 // ── MixedLanguageTests__Esharp_OutParam_BoundByCsharp_OutVar ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::Esharp_OutParam_BoundByCsharp_OutVar topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func try_parse(input: int, out doubled: int) -> bool { doubled = input * 2 return true } // ── OptionalArgTests__BoolDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::BoolDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> bool = Lib.flag() // ── OptionalArgTests__CharDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::CharDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string = Lib.repeat("ab") // ── OptionalArgTests__DoubleDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::DoubleDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> double = Lib.half(8.0) // ── OptionalArgTests__EnumDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::EnumDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.withMode(10) // ── OptionalArgTests__IntDefault_Overridden_When_Passed ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::IntDefault_Overridden_When_Passed topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.scale(5, 3) // ── OptionalArgTests__IntDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::IntDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.scale(5) // ── OptionalArgTests__LongDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::LongDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> long = Lib.big() // ── OptionalArgTests__MultipleDefaults_AllOmitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::MultipleDefaults_AllOmitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.two() // ── OptionalArgTests__MultipleDefaults_FirstPassed_SecondDefaulted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::MultipleDefaults_FirstPassed_SecondDefaulted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.two(7) // ── OptionalArgTests__NullReferenceDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::NullReferenceDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int = Lib.lenOr() // ── OptionalArgTests__StringDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::StringDefault_Used_When_Omitted topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> string = Lib.label("hi") // ── PdbTests__DebugSymbols_DllStillRunsCorrectly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: PdbTests.cs::DebugSymbols_DllStillRunsCorrectly topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func add(a: int, b: int) -> int { var result = a + b return result } // ── PdbTests__NoDebugSymbols_NoPdbFile ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: PdbTests.cs::NoDebugSymbols_NoPdbFile topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func run() -> int { return 42 } // ── PdbTests__Pdb_HasSequencePoints ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: PdbTests.cs::Pdb_HasSequencePoints topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func compute(x: int) -> int { var a = x + 1 var b = a * 2 return b } // ── SourceSpanTests__Binder_PropagatesSpanToStatements ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: SourceSpanTests.cs::Binder_PropagatesSpanToStatements topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func run() -> int { let x = 42 return x } // ── SourceSpanTests__IfStatement_HasCorrectSpan ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: SourceSpanTests.cs::IfStatement_HasCorrectSpan topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func check(x: int) -> int { if x > 0 { return x } return 0 } // ── SourceSpanTests__Parser_CapturesStatementLineNumbers ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: SourceSpanTests.cs::Parser_CapturesStatementLineNumbers topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func add(a: int, b: int) -> int { var total = a total += b return total } // ── TranspilerTests__Transpiles_Attribute_On_Function ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Attribute_On_Function topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [HttpGet] func getUsers() -> string { return "users" } // ── TranspilerTests__Transpiles_Closure_Captures_Let ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Closure_Captures_Let topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func make_adder(base: int) -> int { let offset = 10 let add = func(x: int) -> int { return offset + x } return add(base) } // ── TranspilerTests__Transpiles_Closure_Captures_Var ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Closure_Captures_Var topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func counter() -> int { var count = 0 let increment = func() { count += 1 } increment() increment() return count } // ── TranspilerTests__Transpiles_CompoundAssignment ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_CompoundAssignment topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Math pub func sumTo(n: int) -> int { var total = 0 var i = 0 while i <= n { total += i i += 1 } return total } // ── TranspilerTests__Transpiles_Function_Literal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Function_Literal topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace FnTest func run(items: List) { items.Sort(func(a: int, b: int) -> int { return a - b }) } // ── TranspilerTests__Transpiles_IndexExpression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_IndexExpression topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Arr pub func first(items: List) -> int { return items[0] } // ── TranspilerTests__Transpiles_IndexFromEnd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_IndexFromEnd topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Last pub func last(items: List) -> int { return items[^1] } // ── TranspilerTests__Transpiles_Nullable_Parameter ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Nullable_Parameter topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test func process(name: string?) -> int { return 0 } // ── TranspilerTests__Transpiles_PlainString_NoInterpolation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_PlainString_NoInterpolation topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Plain pub func msg() -> string { return "hello world" } // ── TranspilerTests__Transpiles_RangeExpression ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_RangeExpression topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Slice pub func take(s: string, n: int) -> string { return s[..n] } pub func skip(s: string, n: int) -> string { return s[n..] } pub func sub(s: string, a: int, b: int) -> string { return s[a..b] } // ── TranspilerTests__Transpiles_While_For_And_Spawn ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_While_For_And_Spawn topic: core status: verified // compiles cleanly (no auto-run claim was extracted) namespace Worker pub func sumTo(limit: int) -> int { var i = 0 var total = 0 while i <= limit { total = total + i i = i + 1 } return total } pub func sumAll(values: List) -> int { var total = 0 for value in values { total = total + value } return total } pub func start(values: List) -> Job { return spawn { for value in values { Console.WriteLine(value) } } } // ── EmitterStressTests__Parse_KeywordAsVariableName_ReportsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::Parse_KeywordAsVariableName_ReportsError topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T func run() -> int { let pub = 42 return pub } // ── ILEmitterTests__Emit_LambdaWithTupleReturnType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Emit_LambdaWithTupleReturnType topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { var tasks = List, List)>>() tasks.Add(Task.Run(func() -> (List, List) { return (List(), List()) })) } // ── ILEmitterTests__LocalLet_Reassignment_ReportsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::LocalLet_Reassignment_ReportsError topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func bad() -> int { let x = 1 x = 2 return x } // ── ILEmitterTests__NullConditional_PropertyAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::NullConditional_PropertyAccess topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func safeLen(s: string) -> string { return s?.Length ?? "0" } // ── ILEmitterTests__Parse_LambdaInsideMethodCallChain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_LambdaInsideMethodCallChain topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { let items = List() for item in items.Where(func(s: string) -> bool { return s != "" }).ToList() { let x = item } } // ── ILEmitterTests__Parse_LambdaWithComplexGenericReturnType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_LambdaWithComplexGenericReturnType topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T func run() { var xs = List, List)>>() xs.Add(Task.Run(func() -> (List, List) { return (List(), List()) })) } // ── ILEmitterTests_Coverage_Misc__BclStatic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::BclStatic topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { return // ── ILEmitterTests_GenericDerive__GenericEquals_AcrossFunctionBoundary ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::GenericEquals_AcrossFunctionBoundary topic: core status: unverified // verified behavior: Test.go(...) == true func same(a: Pair, b: Pair) -> bool = a.Equals(b) func go() -> bool { let x = Pair { first: 9, second: 9 } let y = Pair { first: 9, second: 9 } return same(x, y) } // ── ILEmitterTests_GenericDerive__GetHashCode_EqualValuesEqualHash ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::GetHashCode_EqualValuesEqualHash topic: core status: unverified // verified behavior: Test.go(...) == true func go() -> bool { let a = Pair { first: 7, second: 8 } let b = Pair { first: 7, second: 8 } return a.GetHashCode() == b.GetHashCode() } // ── ILEmitterTests_GenericDerive__IntPair_Equal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::IntPair_Equal topic: core status: unverified // verified behavior: Test.go(...) == true func go() -> bool { let a = Pair { first: 3, second: 4 } let b = Pair { first: 3, second: 4 } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__IntPair_NotEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::IntPair_NotEqual topic: core status: unverified // verified behavior: Test.go(...) == false func go() -> bool { let a = Pair { first: 3, second: 4 } let b = Pair { first: 3, second: 5 } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__MixedTypeArgs_Equal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::MixedTypeArgs_Equal topic: core status: unverified // verified behavior: Test.go(...) == true func go() -> bool { let a = Pair { first: "y", second: true } let b = Pair { first: "y", second: true } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__ObjectEquals_DelegatesToTyped ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::ObjectEquals_DelegatesToTyped topic: core status: unverified // verified behavior: Test.go(...) == true func go() -> bool { let a = Pair { first: 1, second: 1 } let b = Pair { first: 1, second: 1 } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__StrPair_Equal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::StrPair_Equal topic: core status: unverified // verified behavior: Test.go(...) == true func go() -> bool { let a = Pair { first: "x", second: 1 } let b = Pair { first: "x", second: 1 } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__StrPair_NotEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::StrPair_NotEqual topic: core status: unverified // verified behavior: Test.go(...) == false func go() -> bool { let a = Pair { first: "x", second: 1 } let b = Pair { first: "y", second: 1 } return a.Equals(b) } // ── ILEmitterTests_GenericDerive__TwoInstantiations_Independent ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::TwoInstantiations_Independent topic: core status: unverified // verified behavior: Test.go(...) == true func ints() -> bool { let a = Pair { first: 1, second: 2 } let b = Pair { first: 1, second: 2 } return a.Equals(b) } // ── ILEmitterTests_Integration__Json_ComputesNestingDepth ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_ComputesNestingDepth topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[1, [2, [3, 4]]]") if r.IsError { return -1 } return depth(r.Value) } // ── ILEmitterTests_Integration__Json_CountsAllNodes ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_CountsAllNodes topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[1, [2, 3], 4]") if r.IsError { return -1 } return countNodes(r.Value) } // ── ILEmitterTests_Integration__Json_EmptyArray ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_EmptyArray topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[]") if r.IsError { return -1 } return countNodes(r.Value) } // ── ILEmitterTests_Integration__Json_NegativeNumbers ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_NegativeNumbers topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[-2, -3]") if r.IsError { return 999 } return sumNumbers(r.Value) } // ── ILEmitterTests_Integration__Json_SumIgnoresNonNumbers ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_SumIgnoresNonNumbers topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[1, true, \"hi\", null, [2, 3]]") if r.IsError { return -1 } return sumNumbers(r.Value) } // ── ILEmitterTests_Integration__Json_SumsNestedNumbers ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_SumsNestedNumbers topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse("[1, [2, 3], 4]") if r.IsError { return -1 } return sumNumbers(r.Value) } // ── ILEmitterTests_Integration__Json_UnterminatedArrayIsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_UnterminatedArrayIsError topic: core status: unverified // verified behavior: Test.go(...) == "unterminated array" func go() -> string { let r = parse("[1, 2") return r.IsError ? r.Error : "ok" } // ── ILEmitterTests_Integration__Json_UnterminatedStringIsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_UnterminatedStringIsError topic: core status: unverified // verified behavior: Test.go(...) == "unterminated string" func go() -> string { let r = parse("\"abc") return r.IsError ? r.Error : "ok" } // ── ILEmitterTests_Integration__Json_WhitespaceTolerant ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Json_WhitespaceTolerant topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> int { let r = parse(" [ 1 ,\t2 ,\n 3 ] ") if r.IsError { return -1 } return sumNumbers(r.Value) } // ── ILEmitterTests_PtrEmbedIface__PointerEmbed_BumpOnceThenValue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_PtrEmbedIface.cs::PointerEmbed_BumpOnceThenValue topic: core status: unverified // verified behavior: Test.go(...) == 41 func once(b: IBumper) -> int { b.bump() return b.value() } // ── ILEmitterTests_PtrEmbedIface__PointerEmbed_TwiceThenInterpolate ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_PtrEmbedIface.cs::PointerEmbed_TwiceThenInterpolate topic: core status: unverified // verified behavior: Test.go(...) == "n=42" func twice(b: IBumper) -> int { b.bump() b.bump() return b.value() } // ── ILEmitterTests_TaskFunc__RegularFunc_Var_Capture_Is_Not_ES2130 ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_TaskFunc.cs::RegularFunc_Var_Capture_Is_Not_ES2130 topic: core status: unverified // verified behavior: reports diagnostic ES2130 namespace Test func go() { var counter = 0 let bump = func() { counter = counter + 1 } bump() } // ── ILEmitterTests3__Arrow_Lambda_Zero_Params ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Arrow_Lambda_Zero_Params topic: core status: unverified // verified behavior: Test.test(...) == 7 namespace Test func test() -> int { let seven = () => 7 return seven() } // ── IndexDiagnosticTests__IndexingList_DoesNotError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: IndexDiagnosticTests.cs::IndexingList_DoesNotError topic: core status: unverified // verified behavior: reports diagnostic ES2145 namespace Test func f(xs: List) -> int { return xs[0] } // ── IndexDiagnosticTests__IndexingString_DoesNotError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: IndexDiagnosticTests.cs::IndexingString_DoesNotError topic: core status: unverified // verified behavior: reports diagnostic ES2145 namespace Test func first(s: string) -> char { return s[0] } // ── MixedLanguageTests__CSharp_Class_Constructed_In_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Class_Constructed_In_Esharp topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func make(n: int) -> Box = Box(n) func valueOf(b: Box) -> int = b.N // ── MixedLanguageTests__CSharp_Class_Field_Read_From_Esharp_Function ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Class_Field_Read_From_Esharp_Function topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func sum(v: Vec) -> int = v.X + v.Y // ── MixedLanguageTests__CSharp_Ctor_With_Multiple_Args_Constructed_In_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Ctor_With_Multiple_Args_Constructed_In_Esharp topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func make(x: int, y: int, label: string) -> Rect = Rect(x, y, label) func area(r: Rect) -> int = r.X * r.Y // ── MixedLanguageTests__CSharp_Enum_Switch_In_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Enum_Switch_In_Esharp topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func label(c: Color) -> string { if c == Color.Red { return "red" } if c == Color.Green { return "green" } return "other" } // ── MixedLanguageTests__CSharp_Property_Read_From_Esharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Property_Read_From_Esharp topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func name_of(p: Person) -> string = p.Name // ── OptionalArgTests__ConstructorDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::ConstructorDefault_Used_When_Omitted topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let c = Counter() return c.Value } // ── OptionalArgTests__InstanceMethodDefault_Used_When_Omitted ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: OptionalArgTests.cs::InstanceMethodDefault_Used_When_Omitted topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test func go() -> int { let c = Counter(100) return c.bump() } // ── RefChoiceCaseViewTests__Json_Transparent_EndToEnd ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: RefChoiceCaseViewTests.cs::Json_Transparent_EndToEnd topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) func go() -> string { // ── TranspilerTests__Reports_Syntax_Diagnostics ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Reports_Syntax_Diagnostics topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Broken pub func nope( -> void { return } // ── TranspilerTests__Transpiles_Defer ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Defer topic: core status: unverified // compiles cleanly (no auto-run claim was extracted) namespace IO pub func process(path: string) -> string { let file = File.Open(path) defer { file.Close() } return file.ReadAll() }