// ── DataContractTests__HeapAllocAttribute_ForcesClass ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::HeapAllocAttribute_ForcesClass topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [HeapAlloc] data Point { x: int y: int } // ── DataContractTests__ReadonlyData_StaysStruct_EvenWhenLarge ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::ReadonlyData_StaysStruct_EvenWhenLarge topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test readonly data Big { a: double b: double c: double d: double e: double f: double g: double h: double i: double } // ── DataContractTests__RecursiveField_DirectSelfReference_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::RecursiveField_DirectSelfReference_Errors topic: data status: verified // verified behavior: reports diagnostic ES2002 namespace Test data Node { value: int next: Node } // ── DataContractTests__RecursiveField_InGenericContainer_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::RecursiveField_InGenericContainer_Errors topic: data status: verified // verified behavior: reports diagnostic ES2002 namespace Test data Tree { value: int children: List } // ── DataContractTests__SmallData_StaysStruct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::SmallData_StaysStruct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Point { x: int y: int } // ── DataContractTests__StackAllocAttribute_ForcesStruct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::StackAllocAttribute_ForcesStruct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [StackAlloc] data Big { a: double b: double c: double d: double e: double f: double g: double h: double i: double } // ── EmitterStressTests__PositionalDataWithListLiterals ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::PositionalDataWithListLiterals topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace T data Config(name: string, url: string, category: string) func defaults() -> List { return [ Config("A", "http://a.com", "cat1"), Config("B", "http://b.com", "cat2"), ] } // ── FeatureMixingTests__Axis3_GenericReadonlyData_WithChain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Axis3_GenericReadonlyData_WithChain topic: data status: verified // verified behavior: Test.run(...) == 303 namespace Test readonly data Pair { first: A second: B } func run() -> int { let p = Pair { first: 1, second: 2 } let q = p with { first: 100 } let r = q with { second: 200 } return r.first + r.second + p.first + p.second } // ── FeatureMixingTests__Axis3_WithOnReadonlyData_OverwritingEmbeddedField ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Axis3_WithOnReadonlyData_OverwritingEmbeddedField topic: data status: verified // verified behavior: Test.run(...) == 34 namespace Test data Vec2 { var x: int var y: int } readonly data Transform { Vec2 scale: int } func run() -> int { let t = Transform { x: 1, y: 2, scale: 3 } let u = t with { Vec2: Vec2 { x: 10, y: 20 } } return u.x + u.y + u.scale + t.x } // ── FeatureMixingTests__Axis3_WithUpdatesEmbeddedField_PromotedAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Axis3_WithUpdatesEmbeddedField_PromotedAccess topic: data status: verified // verified behavior: Test.run(...) == 33 namespace Test data Vec2 { var x: int var y: int } data Wrap { Vec2 tag: int } func run() -> int { let w = Wrap { x: 1, y: 2, tag: 3 } let q = w with { Vec2: Vec2 { x: 10, y: 20 } } return q.x + q.y + q.tag } // ── FeatureMixingTests__Axis6_DeriveEquality_OnGenericData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Axis6_DeriveEquality_OnGenericData topic: data status: verified // verified behavior: Test.strPair(...) == false namespace Test derive equality data Pair { first: A second: B } func intPair() -> bool { let a = Pair { first: 3, second: 4 } let b = Pair { first: 3, second: 4 } return a.Equals(b) } func strPair() -> bool { let a = Pair { first: "x", second: 1 } let b = Pair { first: "y", second: 1 } return a.Equals(b) } // ── FeatureMixingTests__Axis6_DeriveEquality_OnTypeWithEmbeddedField ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FeatureMixingTests.cs::Axis6_DeriveEquality_OnTypeWithEmbeddedField topic: data status: verified // verified behavior: Test.differingEmbedded(...) == false namespace Test data Vec2 { x: int y: int } derive equality data Box { Vec2 tag: int } func sameTag() -> bool { let a = Box { x: 1, y: 2, tag: 7 } let b = Box { x: 1, y: 2, tag: 7 } return a.Equals(b) } func differingEmbedded() -> bool { let a = Box { x: 1, y: 2, tag: 7 } let b = Box { x: 99, y: 2, tag: 7 } return a.Equals(b) } // ── FluentChainTests__Chain_PreservesIdentity_SameObject ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FluentChainTests.cs::Chain_PreservesIdentity_SameObject topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Acc { var n: int init() { self.n = 0 } } func add(a: Acc, x: int) -> Acc { a.n += x return a } func go() -> int { let a = Acc() let b = a.add(40).add(4) return a.n + b.n // 44 + 44 — a and b are the same object } // ── FluentChainTests__RefData_SelfReturn_ChainsOnOneLine ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FluentChainTests.cs::RefData_SelfReturn_ChainsOnOneLine topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Acc { var n: int init() { self.n = 0 } } func add(a: Acc, x: int) -> Acc { a.n += x return a } func go() -> int { let a = Acc().add(5).add(3).add(2) return a.n } // ── FluentChainTests__RefData_SelfReturn_MultiLineLeadingDot ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FluentChainTests.cs::RefData_SelfReturn_MultiLineLeadingDot topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Acc { var n: int init() { self.n = 0 } } func add(a: Acc, x: int) -> Acc { a.n += x return a } func go() -> int { let a = Acc() .add(5) .add(3) .add(2) return a.n } // ── FluentChainTests__ValueData_TransformChain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: FluentChainTests.cs::ValueData_TransformChain topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Vec { x: int, y: int } func add(v: Vec, o: Vec) -> Vec = Vec { x: v.x + o.x, y: v.y + o.y } func scaled(v: Vec, k: int) -> Vec = Vec { x: v.x * k, y: v.y * k } func go() -> int { let r = (Vec { x: 3, y: 2 }).add(Vec { x: 1, y: 4 }).scaled(4) return r.x + r.y // (4,6)*4 = (16,24) → 40 } // ── ForwardReferenceTests__Data_Embeds_LaterData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ForwardReferenceTests.cs::Data_Embeds_LaterData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Transform { Vec2 scale: int } data Vec2 { var x: int var y: int } func go() -> int { var t = Transform { x: 10, y: 20, scale: 5 } t.x += 5 return t.x + t.y + t.scale // 15 + 20 + 5 } // ── ForwardReferenceTests__Data_Field_Of_LaterData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ForwardReferenceTests.cs::Data_Field_Of_LaterData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data A { b: B } data B { n: int } func go() -> int { let a = A { b: B { n: 7 } } return a.b.n } // ── ForwardReferenceTests__Data_ListField_Of_LaterData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ForwardReferenceTests.cs::Data_ListField_Of_LaterData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data A { bs: List } data B { n: int } func go() -> int { let xs = List() xs.Add(B { n: 1 }) xs.Add(B { n: 2 }) let a = A { bs: xs } return a.bs.Count } // ── ILEmitterTests__Attribute_ObsoleteWithMessage_EmittedOntoType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Attribute_ObsoleteWithMessage_EmittedOntoType topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [Obsolete("do not use")] data Legacy { value: int } func run() -> int { return 0 } // ── ILEmitterTests__Attributes_OnDataType_EmittedAsCLRAttributes ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Attributes_OnDataType_EmittedAsCLRAttributes topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [Serializable] ref data Config { name: string } // ── ILEmitterTests__Default_StructZeroed ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Default_StructZeroed topic: data status: verified // verified behavior: Test.run(...) == 0 namespace Test data P { x: int y: int } func run() -> int { let p = default(P) return p.x + p.y } // ── ILEmitterTests__DeriveDebug_NoFields_ShowsEmptyBraces ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveDebug_NoFields_ShowsEmptyBraces topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive debug data Marker { } // ── ILEmitterTests__DeriveDebug_Struct_ToStringContainsFieldValues ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveDebug_Struct_ToStringContainsFieldValues topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive debug data Point { x: int y: int } // ── ILEmitterTests__DeriveEquality_GetHashCode_EqualInstancesHaveEqualHash ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEquality_GetHashCode_EqualInstancesHaveEqualHash topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive equality data Point { x: int y: int } // ── ILEmitterTests__DeriveEquality_RefData_WorksWithDifferentInstances ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEquality_RefData_WorksWithDifferentInstances topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive equality ref data Config { name: string port: int init(name: string, port: int) { self.name = name self.port = port } } // ── ILEmitterTests__DeriveEquality_Struct_DifferingField_AreNotEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEquality_Struct_DifferingField_AreNotEqual topic: data status: verified // verified behavior: Test.go(...) == false namespace Test derive equality data Point { x: int y: int } func go() -> bool { let p1 = Point { x: 3, y: 4 } let p2 = Point { x: 3, y: 5 } return p1.Equals(p2) } // ── ILEmitterTests__DeriveEquality_Struct_NoFields_AlwaysEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEquality_Struct_NoFields_AlwaysEqual topic: data status: verified // verified behavior: Test.go(...) == true namespace Test derive equality data Unit { } func go() -> bool { let a = Unit {} let b = Unit {} return a.Equals(b) } // ── ILEmitterTests__DeriveEquality_Struct_TwoEqualInstances_AreEqual ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEquality_Struct_TwoEqualInstances_AreEqual topic: data status: verified // verified behavior: Test.go(...) == true namespace Test derive equality data Point { x: int y: int } func go() -> bool { let p1 = Point { x: 3, y: 4 } let p2 = Point { x: 3, y: 4 } return p1.Equals(p2) } // ── ILEmitterTests__DeriveEqualityAndDebug_Combined ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::DeriveEqualityAndDebug_Combined topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive equality, debug data Pair { a: int b: string } // ── ILEmitterTests__Emit_RefDataWithMethodsAndLambdas ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Emit_RefDataWithMethodsAndLambdas topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace T data Config(name: string, url: string) ref data Aggregator { configs: List count: int init() { self.configs = List() self.count = 0 } func getCount() -> int = self.count func addConfig(name: string, url: string) = self.configs.Add(Config(name, url)) } // ── ILEmitterTests__ExpressionBodiedMethodInRefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ExpressionBodiedMethodInRefData topic: data status: verified // verified behavior: Test.run(...) == 21 namespace Test ref data Box { value: int init(v: int) { self.value = v } func get() -> int = self.value func doubled() -> int = self.value * 2 } func run() -> int { let b = Box(7) return b.get() + b.doubled() } // ── ILEmitterTests__GenericData_Construction_MixedTypes ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericData_Construction_MixedTypes topic: data status: verified // verified behavior: Test.go(...) == "hello" namespace Test data Pair { first: A second: B } func go() -> string { let p = Pair { first: 42, second: "hello" } return p.second } // ── ILEmitterTests__GenericData_Construction_StructLiteralWithTypeArgs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericData_Construction_StructLiteralWithTypeArgs topic: data status: verified // verified behavior: Test.makePair(...) == 7 namespace Test data Pair { first: A second: B } func makePair() -> int { let p = Pair { first: 3, second: 4 } return p.first + p.second } // ── ILEmitterTests__GenericData_Declaration_EmitsOpenGenericTypeDefinition ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericData_Declaration_EmitsOpenGenericTypeDefinition topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pair { first: A second: B } // ── ILEmitterTests__GenericData_TwoInstantiations_AreDistinctAtRuntime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericData_TwoInstantiations_AreDistinctAtRuntime topic: data status: verified // verified behavior: Test.strPair(...) == "b" namespace Test data Pair { first: A second: B } func intPair() -> int { let p = Pair { first: 10, second: 20 } return p.first } func strPair() -> string { let p = Pair { first: "a", second: "b" } return p.second } // ── ILEmitterTests__GenericExternalType_List_ResolvesCorrectly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericExternalType_List_ResolvesCorrectly topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Container { items: List } // ── ILEmitterTests__GenericExternalType_UserDefinedArg_ResolvesCorrectly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::GenericExternalType_UserDefinedArg_ResolvesCorrectly topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Item { name: string value: int } data Bag { items: List } // ── ILEmitterTests__Init_Constructor_IL_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Init_Constructor_IL_Runtime topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Point { x: int y: int init(px: int, py: int) { x = px y = py } } func getX() -> int { let p = Point { x: 0, y: 0 } return p.x } // ── ILEmitterTests__LetField_IsEmittedAsInitOnly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::LetField_IsEmittedAsInitOnly topic: data status: verified // verified behavior: Test.make(...) == 3 namespace Test data Point { let x: int var y: int } func make() -> int { let p = Point { x: 1, y: 2 } return p.x + p.y } // ── ILEmitterTests__MultiFile_DuplicateDataName_ReportsDiagnostic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::MultiFile_DuplicateDataName_ReportsDiagnostic topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Thing { a: int } // ── ILEmitterTests__PositionalData_BasicConstruction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::PositionalData_BasicConstruction topic: data status: verified // verified behavior: Test.makeAndSum(...) == 7 namespace Test data Vec2(x: int, y: int) func sum(v: Vec2) -> int { return v.x + v.y } func makeAndSum() -> int { let v = Vec2(3, 4) return v.sum() } // ── ILEmitterTests__PositionalData_FieldAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::PositionalData_FieldAccess topic: data status: verified // verified behavior: Test.make(...) == 42 namespace Test data Item(name: string, value: int) func make() -> int { let a = Item("hello", 42) return a.value } // ── ILEmitterTests__PositionalData_RefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::PositionalData_RefData topic: data status: verified // verified behavior: Test.make(...) == "hello" namespace Test ref data Label(text: string, size: int) func getText(l: Label) -> string { return l.text } func make() -> string { let l = Label("hello", 12) return l.getText() } // ── ILEmitterTests__Protocol_VirtualDispatch_IL_Runtime ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Protocol_VirtualDispatch_IL_Runtime topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface ISpeaker { func speak() -> string } ref data Dog : ISpeaker { name: string } func speak(d: Dog) -> string { return "woof" } func announce(s: ISpeaker) -> string { return s.speak() } // ── ILEmitterTests__ReadonlyData_AllFieldsInitOnly ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ReadonlyData_AllFieldsInitOnly topic: data status: verified // verified behavior: Test.make(...) == 7.0f namespace Test readonly data Vec2 { x: float y: float } func make() -> float { let v = Vec2 { x: 3.0, y: 4.0 } return v.x + v.y } // ── ILEmitterTests__ReadonlyData_HasIsReadOnlyAttribute ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::ReadonlyData_HasIsReadOnlyAttribute topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test readonly data Pt { x: int y: int } func make() -> int { return 0 } // ── ILEmitterTests__RefData_ExprBodiedMethod ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::RefData_ExprBodiedMethod topic: data status: verified // verified behavior: Test.test(...) == 2 namespace Test ref data Bag { items: List init() { self.items = List() } func count() -> int = self.items.Count func add(x: int) { self.items.Add(x) } } func test() -> int { let b = Bag() b.add(10) b.add(20) return b.count() } // ── ILEmitterTests__RefDataMethods_BasicInstanceMethod ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::RefDataMethods_BasicInstanceMethod topic: data status: verified // verified behavior: Test.run(...) == 3 namespace Test ref data Counter { value: int init() { self.value = 0 } func inc() { self.value += 1 } func get() -> int = self.value } func run() -> int { let c = Counter() c.inc() c.inc() c.inc() return c.get() } // ── ILEmitterTests__RefDataMethods_PubMethod ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::RefDataMethods_PubMethod topic: data status: verified // verified behavior: Test.run(...) == "world" namespace Test ref data Greeter { name: string init(n: string) { self.name = n } pub func greet() -> string = self.name } func run() -> string { let g = Greeter("world") return g.greet() } // ── ILEmitterTests__Struct_FieldAccess_And_Creation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Struct_FieldAccess_And_Creation topic: data status: verified // verified behavior: Test.scale(...) == 35 namespace Test data Vec2 { x: int y: int } func scale(factor: int, v: Vec2) -> int { return v.x * factor + v.y * factor } // ── ILEmitterTests__VoidExpressionBodiedMethodInRefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::VoidExpressionBodiedMethodInRefData topic: data status: verified // verified behavior: Test.run(...) == 2 namespace Test ref data Bag { items: List init() { self.items = List() } func add(x: int) = self.items.Add(x) func count() -> int = self.items.Count } func run() -> int { let b = Bag() b.add(10) b.add(20) return b.count() } // ── ILEmitterTests__With_CopyAndOverwrite_ProducesNewValue ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::With_CopyAndOverwrite_ProducesNewValue topic: data status: verified // verified behavior: Test.run(...) == 14 namespace Test data Point { x: int y: int } func run() -> int { let p = Point { x: 3, y: 4 } let q = p with { x: 10 } return q.x + q.y } // ── ILEmitterTests__With_DoesNotMutateOriginal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::With_DoesNotMutateOriginal topic: data status: verified // verified behavior: Test.run(...) == 3 namespace Test data Point { x: int y: int } func run() -> int { let p = Point { x: 3, y: 4 } let q = p with { x: 10 } return p.x } // ── ILEmitterTests__With_OnReadonlyData_Works ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::With_OnReadonlyData_Works topic: data status: verified // verified behavior: Test.run(...) == 100 namespace Test readonly data Vec { x: int y: int } func run() -> int { let v = Vec { x: 1, y: 2 } let w = v with { y: 99 } return w.x + w.y } // ── ILEmitterTests_Coverage_Adversarial__Generics_ListOfValueData_AddAndIndex ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_ListOfValueData_AddAndIndex topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pt { x: int, y: int } func go() -> int { let xs = List() xs.Add(Pt { x: 10, y: 20 }) xs.Add(Pt { x: 30, y: 40 }) return xs[0].y + xs[1].x } // ── ILEmitterTests_Coverage_Adversarial__Generics_UserPairSwap ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Generics_UserPairSwap topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pair { first: A second: B } func go() -> int { let p = Pair { first: 3, second: 7 } let q = Pair { first: p.second, second: p.first } return q.first - q.second } // ── ILEmitterTests_Coverage_Adversarial__Ns_AmbiguousResolvedByQualifier ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_AmbiguousResolvedByQualifier topic: data status: verified // verified behavior: Test.go(...) == 9 namespace A data Widget { a: int } // ── ILEmitterTests_Coverage_Adversarial__Ns_LowerCaseTypeName_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_LowerCaseTypeName_IsError topic: data status: verified // verified behavior: reports diagnostic ES2160 namespace Test data widget { x: int } // ── ILEmitterTests_Coverage_Adversarial__Ns_QualifiedFreeFunctionAndType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_QualifiedFreeFunctionAndType topic: data status: verified // verified behavior: Test.go(...) == 42 namespace Lib data Vec { x: int } func bump(v: Vec) -> int { return v.x + 1 } // ── ILEmitterTests_Coverage_Adversarial__Ns_ThreeNamespacesChainedViaUsings ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_ThreeNamespacesChainedViaUsings topic: data status: verified // verified behavior: Test.go(...) == 500 namespace Core data Money { cents: int } // ── ILEmitterTests_Coverage_Adversarial__Ns_UsingBringsTypeAndFreeFuncBare ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_UsingBringsTypeAndFreeFuncBare topic: data status: verified // verified behavior: Test.go(...) == 11 namespace Lib data Vec { x: int } func incr(n: int) -> int { return n + 1 } // ── ILEmitterTests_Coverage_Adversarial__Ns_ValueReceiverFreeCall_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_ValueReceiverFreeCall_IsError topic: data status: verified // verified behavior: reports diagnostic ES2142 namespace Test data Vec { x: int } func bump(v: Vec) -> int { return v.x + 1 } func go() -> int { let v = Vec { x: 10 } return bump(v) } // ── ILEmitterTests_Coverage_Adversarial__Reflection_GetTypeNameOfData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Reflection_GetTypeNameOfData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Widget { id: int } func go() -> string { let w = Widget { id: 1 } return w.GetType().Name } // ── ILEmitterTests_Coverage_Collections__Added_ListOfPointers_ForInSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ListOfPointers_ForInSum topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { n: int } func go() -> int { let xs = [new Box { n: 10 }, new Box { n: 20 }, new Box { n: 30 }] var t = 0 for b in xs { t += b.n } return t } // ── ILEmitterTests_Coverage_Collections__Added_TupleOfValueData_Item ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_TupleOfValueData_Item topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { n: int } func go() -> int { let t = (Box { n: 2 }, Box { n: 5 }) return t.Item2.n } // ── ILEmitterTests_Coverage_Collections__Added_ValueDataList_ForInSum ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::Added_ValueDataList_ForInSum topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { n: int } func go() -> int { let xs = [Box { n: 10 }, Box { n: 20 }, Box { n: 30 }] var t = 0 for b in xs { t += b.n } return t } // ── ILEmitterTests_Coverage_Collections__List_OfData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Collections.cs::List_OfData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pt { x: int, y: int } func go() -> int { let pts = List() pts.Add(Pt { x: 10, y: 20 }) let p = pts[0] return p.x + p.y } // ── ILEmitterTests_Coverage_ControlFlow__Added_For_RangeWithPointerWork ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_For_RangeWithPointerWork topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Acc { total: int } func go() -> int { var a = new Acc { total: 0 } for i in 1..4 { a.total += i } return a.total } // ── ILEmitterTests_Coverage_ControlFlow__Added_ForIn_OverPointerList_Count ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_ForIn_OverPointerList_Count topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { n: int } func go() -> int { let xs = [new Box { n: 1 }, new Box { n: 2 }, new Box { n: 3 }] var c = 0 for b in xs { c += 1 } return c } // ── ILEmitterTests_Coverage_ControlFlow__Added_Ternary_NestedPointer ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::Added_Ternary_NestedPointer topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { n: int } func go() -> int { let pick = true let b = pick ? new Box { n: 2 } : new Box { n: 9 } return b.n } // ── ILEmitterTests_Coverage_ControlFlow__For_AccumulatesIntoData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_ControlFlow.cs::For_AccumulatesIntoData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Acc { var total: int } func go() -> int { var a = Acc { total: 0 } for i in 0..10 { a.total += i } return a.total } // ── ILEmitterTests_Coverage_Data__Data_ConstructAndFieldAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Data_ConstructAndFieldAccess topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Point { x: int, y: int } func go() -> int { let p = Point { x: 10, y: 20 } return p.x + p.y } // ── ILEmitterTests_Coverage_Data__Data_FactoryFunction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Data_FactoryFunction topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Box { v: int } func makeBox(n: int) -> Box { return Box { v: n * 2 } } func go() -> int { return makeBox(21).v } // ── ILEmitterTests_Coverage_Data__Data_InstanceMethodPromotion ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Data_InstanceMethodPromotion topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Sq { side: int } func area(s: Sq) -> int { return s.side * s.side } func go() -> int { let s = Sq { side: 5 } return s.area() } // ── ILEmitterTests_Coverage_Data__Data_MutableField ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Data_MutableField topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Counter { var n: int } func go() -> int { var c = Counter { n: 10 } c.n += 5 return c.n } // ── ILEmitterTests_Coverage_Data__Data_PositionalConstruction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Data_PositionalConstruction topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Vec2(x: int, y: int) func go() -> int { let v = Vec2(3, 4) return v.x + v.y } // ── ILEmitterTests_Coverage_Data__Derive_Equality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Derive_Equality topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive equality data P { x: int, y: int } func go() -> bool { let a = P { x: 1, y: 2 } let b = P { x: 1, y: 2 } return a == b } // ── ILEmitterTests_Coverage_Data__Derive_Equality_Distinct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Derive_Equality_Distinct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test derive equality data P { x: int, y: int } func go() -> bool { let a = P { x: 1, y: 2 } let b = P { x: 1, y: 9 } return a == b } // ── ILEmitterTests_Coverage_Data__Generic_Pair ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Generic_Pair topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pair { first: A, second: B } func go() -> int { let p = Pair { first: 3, second: 5 } return p.first + p.second } // ── ILEmitterTests_Coverage_Data__Generic_SwapPair ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::Generic_SwapPair topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Pair { first: A, second: B } func go() -> int { let p = Pair { first: 2, second: 1 } let q = Pair { first: p.second, second: p.first } return q.first } // ── ILEmitterTests_Coverage_Data__ReadonlyData_With ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::ReadonlyData_With topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test readonly data P { x: int, y: int } func go() -> int { let a = P { x: 3, y: 4 } let b = a with { x: 9 } return b.x + b.y } // ── ILEmitterTests_Coverage_Data__RefData_IdentityMutation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::RefData_IdentityMutation topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Counter { var value: int init() { self.value = 0 } func inc() { self.value += 1 } } func go() -> int { let c = Counter() c.inc() c.inc() c.inc() return c.value } // ── ILEmitterTests_Coverage_Data__StructEmbedding_PromotedAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Data.cs::StructEmbedding_PromotedAccess topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Vec2 { var x: int var y: int } data Transform { Vec2 var scale: int } func go() -> int { var t = Transform { x: 10, y: 20, scale: 5 } t.x += 5 return t.x + t.y } // ── ILEmitterTests_Coverage_Misc__Interface_Conformance ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::Interface_Conformance topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface ISized { func size() -> int } data Crate : ISized { items: int } func size(c: Crate) -> int { return c.items + 1 } func measure(s: ISized) -> int { return s.size() } func go() -> int { let c = Crate { items: 10 } return measure(c) } // ── ILEmitterTests_Coverage_Misc__NestedData_FieldChain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Misc.cs::NestedData_FieldChain topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Inner { v: int } data Outer { inner: Inner, tag: int } func go() -> int { let o = Outer { inner: Inner { v: 4 }, tag: 3 } return o.inner.v + o.tag } // ── ILEmitterTests_Coverage_Numerics__Byte_FieldRoundTrip ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Byte_FieldRoundTrip topic: data status: verified // verified behavior: Test.go(...) == (byte)128 namespace Test data Pixel { r: byte, g: byte, b: byte } func go() -> byte { let p = Pixel { r: 128, g: 64, b: 32 } return p.r } // ── ILEmitterTests_Coverage_Numerics__Double_FieldMagnitudeSquared ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Double_FieldMagnitudeSquared topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Vec { x: double, y: double } func go() -> double { let v = Vec { x: 3.0, y: 4.0 } return v.x * v.x + v.y * v.y } // ── ILEmitterTests_Coverage_Numerics__Int_FieldArithmetic ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Int_FieldArithmetic topic: data status: verified // verified behavior: Test.go(...) == 30 namespace Test data Vec { x: int, y: int } func go() -> int { let v = Vec { x: 10, y: 20 } return v.x + v.y } // ── ILEmitterTests_Coverage_Numerics__Long_FieldRoundTrip ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Numerics.cs::Long_FieldRoundTrip topic: data status: verified // verified behavior: Test.go(...) == 5_000_000_000L namespace Test data Timestamp { epochMs: long } func go() -> long { let t = Timestamp { epochMs: 5000000000 } return t.epochMs } // ── ILEmitterTests_GenericDerive__DeriveDebug_GenericStringFields ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::DeriveDebug_GenericStringFields topic: data status: verified // verified behavior: Test.go(...) == "Pair { first = a, second = b }" derive debug data Pair { first: A second: B } func go() -> string { let p = Pair { first: "a", second: "b" } return p.ToString() } // ── ILEmitterTests_GenericDerive__DeriveDebug_GenericToString ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::DeriveDebug_GenericToString topic: data status: verified // verified behavior: Test.go(...) == "Pair { first = 3, second = 4 }" derive debug data Pair { first: A second: B } func go() -> string { let p = Pair { first: 3, second: 4 } return p.ToString() } // ── ILEmitterTests_GenericDerive__NonGenericDerive_StillWorks ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_GenericDerive.cs::NonGenericDerive_StillWorks topic: data status: verified // verified behavior: Test.go(...) == true derive equality data Point { x: int y: int } func go() -> bool { let a = Point { x: 1, y: 2 } let b = Point { x: 1, y: 2 } return a.Equals(b) } // ── ILEmitterTests_Integration__CrossNamespace_PromotedInstanceMethod ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::CrossNamespace_PromotedInstanceMethod topic: data status: verified // verified behavior: Test.go(...) == 30 namespace Geometry data Point { x: int y: int } func area(p: Point) -> int { return p.x * p.y } // ── ILEmitterTests_Integration__CrossNamespace_ThreeUnitsChained ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::CrossNamespace_ThreeUnitsChained topic: data status: verified // verified behavior: Test.go(...) == 500 namespace Core data Money { cents: int } // ── ILEmitterTests_Integration__CrossNamespace_TypeVisibleViaUsing ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::CrossNamespace_TypeVisibleViaUsing topic: data status: verified // verified behavior: Test.go(...) == 7 namespace Geometry data Point { x: int y: int } // ── ILEmitterTests_Integration__Exe_EntryPointIsWiredToMain ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Exe_EntryPointIsWiredToMain topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test pub ref data Program { var counter: int init() { self.counter = 0 } func run() -> int { for i in 1..5 { self.counter += i } return self.counter } } func main() -> int { let p = Program() return p.run() } // ── ILEmitterTests_Integration__Reflection_BaseTypeOfRefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Reflection_BaseTypeOfRefData topic: data status: verified // verified behavior: Test.go(...) == "Object" namespace Test pub ref data Widget { id: int init(id: int) { self.id = id } } func go() -> string { let w = Widget(1) return w.GetType().BaseType.Name } // ── ILEmitterTests_Integration__Reflection_RuntimeTypeName ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Reflection_RuntimeTypeName topic: data status: verified // verified behavior: Test.go(...) == "Widget" namespace Test pub ref data Widget { id: int init(id: int) { self.id = id } } func go() -> string { let w = Widget(7) return w.GetType().Name } // ── ILEmitterTests_Integration__Reflection_TypeNamespace ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Reflection_TypeNamespace topic: data status: verified // verified behavior: Test.go(...) == "Test" namespace Test pub ref data Widget { id: int init(id: int) { self.id = id } } func go() -> string { let w = Widget(1) return w.GetType().Namespace } // ── ILEmitterTests_Integration__Reflection_ValueDataTypeName ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Integration.cs::Reflection_ValueDataTypeName topic: data status: verified // verified behavior: Test.go(...) == "Point" namespace Test data Point { x: int, y: int } func go() -> string { let p = Point { x: 1, y: 2 } return p.GetType().Name } // ── ILEmitterTests_Nominal__Added_InterfaceMethodViaPromotion ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_InterfaceMethodViaPromotion topic: data status: verified // verified behavior: Test.go(...) == 15 namespace Test interface IArea { func area() -> int } data Rect : IArea { w: int, h: int } func area(r: Rect) -> int = r.w * r.h func go() -> int { let r = Rect { w: 3, h: 5 } let a: IArea = r return a.area() } // ── ILEmitterTests_Nominal__Added_InterfaceReturnedFromFunction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_InterfaceReturnedFromFunction topic: data status: verified // verified behavior: Test.go(...) == 8 namespace Test interface ISized { func size() -> int } ref data Crate : ISized { n: int init(n: int) { self.n = n } func size() -> int = self.n } func make() -> ISized = Crate(8) func go() -> int { let s = make() return s.size() } // ── ILEmitterTests_Nominal__Added_MarkerInterface_NoMethods_Conforms ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_MarkerInterface_NoMethods_Conforms topic: data status: verified // verified behavior: Test.go(...) == 5 namespace Test interface ITag { } data Item : ITag { v: int } func tagged(t: ITag) -> int = 5 func go() -> int { let i = Item { v: 1 } return tagged(i) } // ── ILEmitterTests_Nominal__Added_RefData_DeclaresInterface_Works ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_RefData_DeclaresInterface_Works topic: data status: verified // verified behavior: Test.go(...) == 7 namespace Test interface ICounter { func get() -> int } ref data Counter : ICounter { value: int init(v: int) { self.value = v } func get() -> int = self.value } func read(c: ICounter) -> int = c.get() func go() -> int { let c = Counter(7) return read(c) } // ── ILEmitterTests_Nominal__Added_TwoInterfaces_BothSatisfied ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_TwoInterfaces_BothSatisfied topic: data status: verified // verified behavior: Test.go(...) == 30 namespace Test interface INamed { func label() -> int } interface ISized { func size() -> int } data Widget : INamed, ISized { a: int, b: int } func label(w: Widget) -> int = w.a func size(w: Widget) -> int = w.b func both(n: INamed, s: ISized) -> int = n.label() + s.size() func go() -> int { let w = Widget { a: 10, b: 20 } return both(w, w) } // ── ILEmitterTests_Nominal__Added_UndeclaredStructuralMatch_WarnsES2153 ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_UndeclaredStructuralMatch_WarnsES2153 topic: data status: verified // verified behavior: reports diagnostic ES2153 namespace Test interface ISized { func size() -> int } data Crate { items: int } func size(c: Crate) -> int = c.items // ── ILEmitterTests_Nominal__ExplicitConformance_ExactMatch_Works ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::ExplicitConformance_ExactMatch_Works topic: data status: verified // verified behavior: Test.go(...) == 11 namespace Test interface ISized { func size() -> int } data Crate : ISized { items: int } func size(c: Crate) -> int { return c.items + 1 } func measure(s: ISized) -> int { return s.size() } func go() -> int { let c = Crate { items: 10 } return measure(c) } // ── ILEmitterTests_Nominal__Undeclared_StructuralMatch_RejectedAndSuggested ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Undeclared_StructuralMatch_RejectedAndSuggested topic: data status: verified // verified behavior: reports diagnostic ES2153 namespace Test interface ISized { func size() -> int } data Crate { items: int } func size(c: Crate) -> int { return c.items + 1 } func measure(s: ISized) -> int { return s.size() } func go() -> int { let c = Crate { items: 10 } return measure(c) } // ── ILEmitterTests_PtrEmbedIface__ValueEmbed_PromotedFieldAccess ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_PtrEmbedIface.cs::ValueEmbed_PromotedFieldAccess topic: data status: verified // verified behavior: Test.go(...) == 15 data Vec2 { var x: int var y: int } // ── ILEmitterTests_Returns__NoReturnsClause_NoArrow_DefaultsToVoid ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::NoReturnsClause_NoArrow_DefaultsToVoid topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Q { n: int init(n: int) { self.n = n } func touch() { } // no -> Type, no returns clause: void } func go() { let q = Q(0) q.touch() } // ── ILEmitterTests_Returns__Returns_Clause_On_RefData_Bound_Method_Has_Correct_ReturnType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Clause_On_RefData_Bound_Method_Has_Correct_ReturnType topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Q { returns Q n: int init(n: int) { self.n = n } func bump() { return Q(self.n + 1) } } // ── ILEmitterTests_Returns__Returns_Clause_On_RefData_Explicit_Arrow_Wins ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Clause_On_RefData_Explicit_Arrow_Wins topic: data status: verified // verified behavior: Test.go(...) == 1 namespace Test ref data Q { returns Q n: int init(n: int) { self.n = n } func bump() { return Q(self.n + 1) } func count() -> int { return self.n } } func go() -> int { let q = Q(0) return q.bump().count() } // ── ILEmitterTests_Returns__Returns_Clause_On_RefData_Fluent_Chaining ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Clause_On_RefData_Fluent_Chaining topic: data status: verified // verified behavior: Test.go(...) == 3 namespace Test ref data Q { returns Q n: int init(n: int) { self.n = n } func bump() { return Q(self.n + 1) } } func go() -> int { let q = Q(0) let r = q.bump().bump().bump() return r.n } // ── ILEmitterTests_Returns__Returns_Clause_On_RefData_Sets_Default_For_Methods ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Clause_On_RefData_Sets_Default_For_Methods topic: data status: verified // verified behavior: Test.go(...) == 1 namespace Test ref data Q { returns Q n: int init(n: int) { self.n = n } func bump() { return Q(self.n + 1) } } func go() -> int { let q = Q(0) let r = q.bump() return r.n } // ── ILEmitterTests_Returns__Returns_Clause_Sees_Cross_Method_Resolution_With_DataType ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Clause_Sees_Cross_Method_Resolution_With_DataType topic: data status: verified // verified behavior: Test.go(...) == 2 namespace Test ref data Counter { returns Counter n: int init(n: int) { self.n = n } func inc() { return Counter(self.n + 1) } func twice() { return self.inc().inc() } } func go() -> int { return Counter(0).twice().n } // ── ILEmitterTests_Returns__Returns_Keyword_Synonym_On_Inline_Method ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Returns.cs::Returns_Keyword_Synonym_On_Inline_Method topic: data status: verified // verified behavior: Test.go(...) == 10 namespace Test ref data Box { n: int init(n: int) { self.n = n } func twice() returns int { return self.n * 2 } } func go() -> int { return Box(5).twice() } // ── ILEmitterTests2__Bank_Account_With_Data_Type_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Bank_Account_With_Data_Type_Pin topic: data status: verified // verified behavior: Test.run(...) == 75 namespace Test data Account { balance: int } func deposit(a: Account, amount: int) -> Account = a with { balance: a.balance + amount } func withdraw(a: Account, amount: int) -> Account = a with { balance: a.balance - amount } func run() -> int { let opened = Account { balance: 0 } let after_deposit = opened.deposit(100) let after_withdraw = after_deposit.withdraw(30) let final = after_withdraw.deposit(5) return final.balance } // ── ILEmitterTests2__Composite_Nested_Literal ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Composite_Nested_Literal topic: data status: verified // verified behavior: Test.test(...) == 111 namespace Test data Outer { x: int, inner: Inner } data Inner { a: int, b: int } func test() -> int { let o = Outer { x: 1, inner: Inner { a: 10, b: 100 } } return o.x + o.inner.a + o.inner.b } // ── ILEmitterTests2__Composite_Partial_With_Rebinds_One_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Composite_Partial_With_Rebinds_One_Field topic: data status: verified // verified behavior: Test.test(...) == 103 namespace Test data Point { x: int, y: int, z: int } func test() -> int { let p = Point { x: 1, y: 2, z: 3 } let q = p with { y: 99 } return q.x + q.y + q.z } // ── ILEmitterTests2__Data_Method_Chain_Via_With_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Data_Method_Chain_Via_With_Pin topic: data status: verified // verified behavior: Test.test(...) == 321 namespace Test data Vec3 { x: int, y: int, z: int } func with_x(v: Vec3, nx: int) -> Vec3 = v with { x: nx } func with_y(v: Vec3, ny: int) -> Vec3 = v with { y: ny } func with_z(v: Vec3, nz: int) -> Vec3 = v with { z: nz } func test() -> int { let origin = Vec3 { x: 0, y: 0, z: 0 } let stepped = origin.with_x(1).with_y(2).with_z(3) return stepped.x + stepped.y * 10 + stepped.z * 100 } // ── ILEmitterTests2__Function_Returns_Data_Used_By_Caller ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Function_Returns_Data_Used_By_Caller topic: data status: verified // verified behavior: Test.test(...) == 30 namespace Test data Pair { left: int, right: int } func make(a: int, b: int) -> Pair = Pair { left: a, right: b } func test() -> int { let p = make(10, 20) return p.left + p.right } // ── ILEmitterTests2__Interface_Dispatch_Through_Promoted_Method_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Interface_Dispatch_Through_Promoted_Method_Pin topic: data status: verified // verified behavior: Test.test(...) == 73 namespace Test interface IShape { func area() -> int } data Square : IShape { side: int } data Circle : IShape { radius: int } func area(s: Square) -> int = s.side * s.side func area(c: Circle) -> int = 3 * c.radius * c.radius func test() -> int { let sq = Square { side: 5 } let ci = Circle { radius: 4 } return sq.area() + ci.area() } // ── ILEmitterTests2__Nested_Data_Field_Access_Two_Deep ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Nested_Data_Field_Access_Two_Deep topic: data status: verified // verified behavior: Test.test(...) == 99 namespace Test data Inner { v: int } data Outer { inner: Inner } func test() -> int { let o = Outer { inner: Inner { v: 99 } } return o.inner.v } // ── ILEmitterTests2__Promoted_Instance_Methods_On_Data_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Promoted_Instance_Methods_On_Data_Pin topic: data status: verified // verified behavior: Test.describe(...) == 38 namespace Test data Rect { width: int, height: int } func area(r: Rect) -> int = r.width * r.height func perimeter(r: Rect) -> int = (r.width + r.height) * 2 func is_square(r: Rect) -> bool = r.width == r.height func describe() -> int { let r = Rect { width: 4, height: 5 } var score = 0 if r.is_square() { score = score + 1000 } return r.area() + r.perimeter() + score } // ── ILEmitterTests2__RefData_Different_Instances_Not_Identity_Equal_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::RefData_Different_Instances_Not_Identity_Equal_Pin topic: data status: verified // verified behavior: Test.test(...) == false namespace Test ref data Box { pub value: int init(v: int) { self.value = v } } func test() -> bool { let a = Box(5) let b = Box(5) return a == b } // ── ILEmitterTests2__RefData_Identity_Equal_To_Self_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::RefData_Identity_Equal_To_Self_Pin topic: data status: verified // verified behavior: Test.test(...) == true namespace Test ref data Box { pub value: int init(v: int) { self.value = v } } func test() -> bool { let a = Box(5) let b = a return a == b } // ── ILEmitterTests2__Triple_Nested_Data_Field_Access ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests2.cs::Triple_Nested_Data_Field_Access topic: data status: verified // verified behavior: Test.test(...) == 42 namespace Test data A { v: int } data B { a: A } data C { b: B } func test() -> int { let c = C { b: B { a: A { v: 42 } } } return c.b.a.v } // ── ILEmitterTests3__Data_Composite_With_String_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_Composite_With_String_Field topic: data status: verified // verified behavior: Test.test(...) == "alice:30" namespace Test data User { name: string, age: int } func test() -> string { let u = User { name: "alice", age: 30 } return u.name + ":" + u.age.ToString() } // ── ILEmitterTests3__Data_Equality_Field_By_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_Equality_Field_By_Field topic: data status: verified // verified behavior: Test.test(...) == 1 namespace Test data P { x: int, y: int } func test() -> int { let a = P { x: 1, y: 2 } let b = P { x: 1, y: 2 } if a.x == b.x && a.y == b.y { return 1 } return 0 } // ── ILEmitterTests3__Data_Field_Read_After_Local_Assign ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_Field_Read_After_Local_Assign topic: data status: verified // verified behavior: Test.test(...) == 12 namespace Test data P { x: int, y: int } func test() -> int { var p = P { x: 0, y: 0 } p.x = 5 p.y = 7 return p.x + p.y } // ── ILEmitterTests3__Data_Multiple_Construction_Sites ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_Multiple_Construction_Sites topic: data status: verified // verified behavior: Test.test(...) == 21 namespace Test data Coord { x: int, y: int } func test() -> int { let a = Coord { x: 1, y: 2 } let b = Coord { x: 3, y: 4 } let c = Coord { x: 5, y: 6 } return a.x + b.x + c.x + a.y + b.y + c.y } // ── ILEmitterTests3__Data_Single_Field_Composite ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_Single_Field_Composite topic: data status: verified // verified behavior: Test.test(...) == 99 namespace Test data Wrap { v: int } func test() -> int { let w = Wrap { v: 99 } return w.v } // ── ILEmitterTests3__Data_With_All_Default_Fields_Compiles ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_With_All_Default_Fields_Compiles topic: data status: verified // verified behavior: Test.test(...) == 0 namespace Test data Empty { } func test() -> int { let e = Empty { } return 0 } // ── ILEmitterTests3__Data_With_Preserves_Other_Fields ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_With_Preserves_Other_Fields topic: data status: verified // verified behavior: Test.test(...) == 28 namespace Test data Cfg { a: int, b: int, c: int, d: int } func test() -> int { let c = Cfg { a: 1, b: 2, c: 3, d: 4 } let c2 = c with { b: 20 } return c2.a + c2.b + c2.c + c2.d } // ── ILEmitterTests3__Data_With_Single_Field_Update ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_With_Single_Field_Update topic: data status: verified // verified behavior: Test.test(...) == 1004 namespace Test data P { x: int, y: int } func test() -> int { let p = P { x: 3, y: 4 } let q = p with { x: 10 } return q.x * 100 + q.y } // ── ILEmitterTests3__Data_With_Used_In_Return ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Data_With_Used_In_Return topic: data status: verified // verified behavior: Test.test(...) == 15 namespace Test data P { x: int, y: int } func translate(p: P, dx: int) -> P = p with { x: p.x + dx } func test() -> int { let start = P { x: 0, y: 5 } let moved = start.translate(10) return moved.x + moved.y } // ── ILEmitterTests3__Embedding_Direct_Field_Access_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Embedding_Direct_Field_Access_Pin topic: data status: verified // verified behavior: Test.test(...) == 100 namespace Test data Inner { value: int } data Outer { pub Inner } func test() -> int { let o = Outer { Inner: Inner { value: 100 } } return o.Inner.value } // ── ILEmitterTests3__Function_Returns_RefData_Pin ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Function_Returns_RefData_Pin topic: data status: verified // verified behavior: Test.test(...) == 7 namespace Test ref data Card { pub face: int init(f: int) { self.face = f } } func make(n: int) -> Card = Card(n) func test() -> int { let c = make(7) return c.face } // ── ILEmitterTests3__Generic_Pair_Construction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Generic_Pair_Construction topic: data status: verified // verified behavior: Test.test(...) == 7 namespace Test data Pair { first: A, second: B } func test() -> int { let p = Pair { first: 3, second: 4 } return p.first + p.second } // ── ILEmitterTests3__Generic_Pair_String_Int ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Generic_Pair_String_Int topic: data status: verified // verified behavior: Test.test(...) == "x7" namespace Test data Pair { first: A, second: B } func test() -> string { let p = Pair { first: "x", second: 7 } return p.first + p.second.ToString() } // ── ILEmitterTests3__Interface_Method_Resolution_On_Data ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Interface_Method_Resolution_On_Data topic: data status: verified // verified behavior: Test.test(...) == 42 namespace Test interface IGet { func get() -> int } data Box : IGet { v: int } func get(b: Box) -> int = b.v func test() -> int { let b = Box { v: 42 } return b.get() } // ── ILEmitterTests3__Interface_Method_Returns_Bool ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Interface_Method_Returns_Bool topic: data status: verified // verified behavior: Test.test(...) == true namespace Test interface ITest { func passes() -> bool } data Suite : ITest { flag: bool } func passes(s: Suite) -> bool = s.flag func test() -> bool { let s = Suite { flag: true } return s.passes() } // ── ILEmitterTests3__Interface_Polymorphic_Param ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::Interface_Polymorphic_Param topic: data status: verified // verified behavior: Test.test(...) == 30 namespace Test interface IGet { func get() -> int } data A : IGet { x: int } data B : IGet { y: int } func get(a: A) -> int = a.x func get(b: B) -> int = b.y func consume(g: IGet) -> int = g.get() func test() -> int { let a = A { x: 10 } let b = B { y: 20 } return consume(a) + consume(b) } // ── ILEmitterTests3__RefData_Field_Mutation_Persists ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::RefData_Field_Mutation_Persists topic: data status: verified // verified behavior: Test.test(...) == 15 namespace Test ref data Bag { var capacity: int init(c: int) { self.capacity = c } } func test() -> int { let b = Bag(0) b.capacity = 10 b.capacity = b.capacity + 5 return b.capacity } // ── ILEmitterTests3__RefData_Init_Stores_Param_To_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::RefData_Init_Stores_Param_To_Field topic: data status: verified // verified behavior: Test.test(...) == 42 namespace Test ref data Box { pub n: int init(value: int) { self.n = value } } func test() -> int { let b = Box(42) return b.n } // ── ILEmitterTests3__RefData_Instance_Method_Accesses_Self_Field ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::RefData_Instance_Method_Accesses_Self_Field topic: data status: verified // verified behavior: Test.test(...) == 3 namespace Test ref data Counter { var n: int init() { self.n = 0 } func bump() { self.n = self.n + 1 } func value() -> int = self.n } func test() -> int { let c = Counter() c.bump() c.bump() c.bump() return c.value() } // ── ILEmitterTests3__RefData_Multi_Field_Construction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests3.cs::RefData_Multi_Field_Construction topic: data status: verified // verified behavior: Test.test(...) == 321 namespace Test ref data Point3 { pub x: int pub y: int pub z: int init(a: int, b: int, c: int) { self.x = a self.y = b self.z = c } } func test() -> int { let p = Point3(1, 2, 3) return p.x + p.y * 10 + p.z * 100 } // ── IndexDiagnosticTests__IndexingData_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: IndexDiagnosticTests.cs::IndexingData_Errors topic: data status: verified // verified behavior: reports diagnostic ES2145 namespace Test data P { x: int } func f(p: P) -> int { return p[0] } // ── MixedLanguageTests__CSharp_Interface_Implemented_By_Esharp_Data ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::CSharp_Interface_Implemented_By_Esharp_Data topic: data status: verified // verified behavior: Test.null(...) == "greeter" namespace Test data Greeter : IDescribable {} func describe(g: Greeter) -> string = "greeter" // ── MixedLanguageTests__Esharp_Data_Type_Used_From_Csharp ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: MixedLanguageTests.cs::Esharp_Data_Type_Used_From_Csharp topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test pub data Point { x: int, y: int } // ── TranspilerTests__BoxingDiag_NoWarn_RefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::BoxingDiag_NoWarn_RefData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IWidget { func render() -> string } ref data Button : IWidget { label: string } func render(b: Button) -> string { return b.label } func test() -> string { let w: IWidget = Button { label: "ok" } return w.render() } // ── TranspilerTests__Classifies_Nested_Struct_Within_Threshold ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Classifies_Nested_Struct_Within_Threshold topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Lines data Vec2 { x: float y: float } data Line { a: Vec2 b: Vec2 } // ── TranspilerTests__Classifies_Oversized_As_Struct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Classifies_Oversized_As_Struct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Big data Big { a: decimal b: int } // ── TranspilerTests__Classifies_RefData_As_Class ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Classifies_RefData_As_Class topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Cfg ref data Config { timeout: int } // ── TranspilerTests__Classifies_RefField_As_Struct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Classifies_RefField_As_Struct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Wrap data Wrapper { name: string } // ── TranspilerTests__Classifies_Small_ValueType_As_Struct ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Classifies_Small_ValueType_As_Struct topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Geo data Point { x: int y: int } // ── TranspilerTests__ExplicitConformance_Satisfied ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::ExplicitConformance_Satisfied topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IRenderable { func render() -> string } ref data Button : IRenderable { label: string } func render(b: Button) -> string { return b.label } // ── TranspilerTests__MultiFile_CrossFile_Instance_Method_Promotion ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::MultiFile_CrossFile_Instance_Method_Promotion topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Types data Counter { value: int } // ── TranspilerTests__MultiFile_CrossFile_Protocol_Satisfaction ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::MultiFile_CrossFile_Protocol_Satisfaction topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Proto interface IDescribable { func describe() -> string } data Widget : IDescribable { label: string } func describe(w: Widget) -> string { return w.label } // ── TranspilerTests__MultiFile_CrossFile_Type_Reference ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::MultiFile_CrossFile_Type_Reference topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Types data Point { x: int y: int } // ── TranspilerTests__Transpiles_Attribute_On_RefData ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Attribute_On_RefData topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [Route("/api/users")] [Authorize] ref data UserController { path: string } // ── TranspilerTests__Transpiles_Attribute_With_Arguments ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Attribute_With_Arguments topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test [MaxLength(100)] ref data Config { name: string } // ── TranspilerTests__Transpiles_Data_With_External_Interface ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Data_With_External_Interface topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace IO data FileHandle : IDisposable { path: string } func Dispose(h: FileHandle) { Console.WriteLine("closed") } // ── TranspilerTests__Transpiles_Derive_Debug ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Derive_Debug topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Dbg derive debug data Color { r: int g: int b: int } // ── TranspilerTests__Transpiles_Derive_Equality ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Derive_Equality topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Eq derive equality data Point { x: int y: int } // ── TranspilerTests__Transpiles_Generic_Data ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Generic_Data topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Gen data Pair { first: A second: B } func makePair(a: A, b: B) -> Pair { return Pair { first: a, second: b } } // ── TranspilerTests__Transpiles_Init_Constructor ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Init_Constructor topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Connection { host: string port: int init(h: string, p: int) { host = h port = p } } // ── TranspilerTests__Transpiles_Nullable_Return_Type ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_Nullable_Return_Type topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data User { name: string } func find(id: int) -> User? { return nil } // ── TranspilerTests__Transpiles_ValueEmbedding ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::Transpiles_ValueEmbedding topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test data Base { var x: int var y: int } data Widget { Base label: string } func getX() -> int { var w = Widget { x: 10, y: 20, label: "test" } return w.x } // ── TranspilerTests__VirtualDispatch_ProtocolTypedParameter ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::VirtualDispatch_ProtocolTypedParameter topic: data status: verified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IWidget { func render() -> string } ref data Button : IWidget { label: string } func render(b: Button) -> string { return b.label } func display(w: IWidget) -> string { return w.render() } // ── DataContractTests__HeapAllocAttribute_OnRefData_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::HeapAllocAttribute_OnRefData_Errors topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test [HeapAlloc] ref data Conn { host: string port: int } // ── DataContractTests__InitBlock_OnData_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::InitBlock_OnData_Errors topic: data status: unverified // verified behavior: reports diagnostic ES3012 namespace Test data Point { x: int y: int init(px: int, py: int) { self.x = px self.y = py } } // ── DataContractTests__InitBlock_OnRefData_Ok ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::InitBlock_OnRefData_Ok topic: data status: unverified // verified behavior: reports diagnostic ES3012 namespace Test ref data Point { x: int y: int init(px: int, py: int) { self.x = px self.y = py } } // ── DataContractTests__PositionalForm_OnData_StillWorks ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::PositionalForm_OnData_StillWorks topic: data status: unverified // verified behavior: reports diagnostic ES3012 namespace Test data Vec2(x: int, y: int) func main() { let v = Vec2(3, 4) } // ── DataContractTests__RecursiveField_ListOfPointer_Ok ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::RecursiveField_ListOfPointer_Ok topic: data status: unverified // verified behavior: reports diagnostic ES2002 namespace Test data Tree { value: int children: List<*Tree> } // ── DataContractTests__RecursiveField_PointerForm_Ok ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::RecursiveField_PointerForm_Ok topic: data status: unverified // verified behavior: reports diagnostic ES2002 namespace Test data Node { value: int next: *Node } // ── DataContractTests__RecursiveField_RefDataAllowsSelfReference ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::RecursiveField_RefDataAllowsSelfReference topic: data status: unverified // verified behavior: reports diagnostic ES2002 namespace Test ref data Node { value: int next: Node } // ── DataContractTests__StackAllocAndHeapAlloc_Together_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::StackAllocAndHeapAlloc_Together_Errors topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test [StackAlloc] [HeapAlloc] data Point { x: int y: int } // ── DataContractTests__StackAllocAttribute_OnRefData_Errors ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: DataContractTests.cs::StackAllocAttribute_OnRefData_Errors topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test [StackAlloc] ref data Conn { host: string port: int } // ── EmitterStressTests__InterfaceImplWithLambdaArgs ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::InterfaceImplWithLambdaArgs topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T ref data Plugin { name: string init() { self.name = "test" } pub func Name() -> string = self.name pub func Run(app: WebApplication) { app.MapGet("/api/test", func(q: string) -> IResult { return Results.Json(q ?? "default") }) app.MapGet("/api/ping", func() -> IResult = Results.Json("pong")) } } // ── EmitterStressTests__Parse_ConstructorCallWith6ArgsInForLoop ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: EmitterStressTests.cs::Parse_ConstructorCallWith6ArgsInForLoop topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T data Item(a: string, b: string, c: string, d: DateTimeOffset, e: string, f: string) func run(synd: object, feed: object) { var items = List() for entry in synd.Items { let link = entry.Links.Count > 0 ? entry.Links[0].Uri.ToString() : "" let summary = entry.Summary?.Text ?? "" let pub = entry.PublishDate != DateTimeOffset.MinValue ? entry.PublishDate : entry.LastUpdatedTime items.Add(Item(entry.Title.Text, link, feed.name, pub, summary, feed.category)) } } // ── ILEmitterTests__LetField_AssignmentOutsideInit_ReportsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::LetField_AssignmentOutsideInit_ReportsError topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test data Point { let x: int y: int } func bad() -> int { var p = Point { x: 1, y: 2 } p.x = 99 return p.x } // ── ILEmitterTests__Parse_ExprBodiedWithLock ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_ExprBodiedWithLock topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Foo { x: int lock: object init() { self.x = 0 self.lock = object() } func getX() -> int = self.x } // ── ILEmitterTests__Parse_InterfaceImplementation ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_InterfaceImplementation topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T ref data MyPlugin : IPlugin { init() { } pub func Name() -> string = "test" pub func Run(app: WebApplication) { app.MapGet("/api/test", func(q: string) -> IResult { return Results.Json(q ?? "") }) app.MapGet("/api/ping", func() -> IResult = Results.Json("pong")) } } // ── ILEmitterTests__Parse_RefDataWithMultipleMethods ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::Parse_RefDataWithMultipleMethods topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace T ref data Svc { items: List obj: object init() { self.items = List() self.obj = object() } func start() { self.items.Add("a") } func stop() { self.items.Clear() } func query(filter: string) -> List { return self.items } func count() -> int = self.items.Count func addItem(s: string) = self.items.Add(s) } // ── ILEmitterTests__StructPromotion_LargeStruct_SilentlyPromotesToClass ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::StructPromotion_LargeStruct_SilentlyPromotesToClass topic: data status: unverified // verified behavior: reports diagnostic ES2001 namespace Test data Big { a: double b: double c: double d: double e: double f: double g: double h: double i: double } // ── ILEmitterTests__StructPromotion_ManyRefFields_SilentlyPromotesToClass ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::StructPromotion_ManyRefFields_SilentlyPromotesToClass topic: data status: unverified // verified behavior: reports diagnostic ES2001 namespace Test data Refs { a: string b: string c: string d: int } // ── ILEmitterTests__StructPromotion_RefData_NoWarning ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::StructPromotion_RefData_NoWarning topic: data status: unverified // verified behavior: reports diagnostic ES2001 namespace Test ref data Big { a: double b: double c: double d: double e: double f: double g: double h: double i: double } // ── ILEmitterTests__StructPromotion_StoredInCollection_SilentlyPromotesToClass ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::StructPromotion_StoredInCollection_SilentlyPromotesToClass topic: data status: unverified // verified behavior: reports diagnostic ES2001 namespace Test data Item { a: double b: double c: double d: double e: double } data Container { items: List } // ── ILEmitterTests__With_OnRefData_ReportsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests.cs::With_OnRefData_ReportsError topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test ref data Node { value: int } func run() -> int { let n = Node { value: 1 } let m = n with { value: 2 } return m.value } // ── ILEmitterTests_Coverage_Adversarial__Ns_BareCrossNamespace_WithoutUsing_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Coverage_Adversarial.cs::Ns_BareCrossNamespace_WithoutUsing_IsError topic: data status: unverified // verified behavior: reports diagnostic ES2150 namespace Lib data Vec { x: int } // ── ILEmitterTests_Nominal__Added_GenericConformance ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_GenericConformance topic: data status: unverified // verified behavior: Test.go(...) == 9 generic value data implementing an interface (promoted generic-method self-param) not yet supported // ── ILEmitterTests_Nominal__Added_ParamTypeMismatch_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_ParamTypeMismatch_IsError topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IAdder { func add(x: int) -> int } data Calc : IAdder { base: int } func add(c: Calc, x: string) -> int = c.base // ── ILEmitterTests_Nominal__Added_UndeclaredStructuralMatch_IsNotConformance ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Added_UndeclaredStructuralMatch_IsNotConformance topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface ISized { func size() -> int } data Crate { items: int } func size(c: Crate) -> int = c.items func measure(s: ISized) -> int = s.size() func go() -> int { let c = Crate { items: 3 } return measure(c) } // ── ILEmitterTests_Nominal__Declared_ParamTypeMismatch_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Declared_ParamTypeMismatch_IsError topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IAdder { func add(n: int) -> int } data Box : IAdder { v: int } func add(b: Box, n: string) -> int { return b.v } // ── ILEmitterTests_Nominal__Declared_ReturnTypeMismatch_IsError ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: ILEmitterTests_Nominal.cs::Declared_ReturnTypeMismatch_IsError topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface ISized { func size() -> int } data Crate : ISized { items: int } func size(c: Crate) -> string { return "x" } // ── TranspilerTests__BoxingDiag_Warns_ValueType_As_Protocol ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::BoxingDiag_Warns_ValueType_As_Protocol topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IWidget { func render() -> string } data SmallWidget { label: string } func render(w: SmallWidget) -> string { return w.label } func test() -> string { let w: IWidget = SmallWidget { label: "hi" } return w.render() } // ── TranspilerTests__ExplicitConformance_Missing_Method_Reports_Error ── // E# — a verified example from the E# language corpus (CLR language; .es, not ECMAScript). // provenance: TranspilerTests.cs::ExplicitConformance_Missing_Method_Reports_Error topic: data status: unverified // compiles cleanly (no auto-run claim was extracted) namespace Test interface IRenderable { func render() -> string } ref data Button : IRenderable { label: string }