diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 285e2fd..31d1b47 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" # Interim: track `core` by git rev (see design/runtime-repo-structure.md — no # crates.io publishing at this stage). Local iteration: uncomment the # workspace-root [patch] onto a sibling checkout. -comline-core = { git = "https://github.com/ComlineProject/core", rev = "aa84d970d3295df59cc3e620bdb71bf96382f97b" } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10a36b587d14d1b9672fba65d8f3712962" } eyre = "0.6.8" diff --git a/conformance/Cargo.toml b/conformance/Cargo.toml index c677cfb..f0d8fd8 100644 --- a/conformance/Cargo.toml +++ b/conformance/Cargo.toml @@ -10,9 +10,9 @@ publish = false # to their own repos. See design/runtime-repo-structure.md (rollout step 3). [dependencies] -comline-core = { git = "https://github.com/ComlineProject/core", rev = "aa84d970d3295df59cc3e620bdb71bf96382f97b" } +comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10a36b587d14d1b9672fba65d8f3712962" } [dev-dependencies] comline-codegen = { path = "../codegen" } -comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "070c77759b77f3f9a51ae217734277c95414f71f" } -comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "97d8b2ea3db8b0489eaa8a1ad1fa2e89cfb391e6" } +comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "a70cafcdd2015686ff1dbfba59b2b56ff70b730d" } +comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "7f2ddd3ed97c412389e0a0bf06420774b1a659d3" } diff --git a/conformance/src/lib.rs b/conformance/src/lib.rs index 1f408a6..5183224 100644 --- a/conformance/src/lib.rs +++ b/conformance/src/lib.rs @@ -67,19 +67,34 @@ fn function( name: &str, args: Vec, ret: Option<&str>, - throws: Vec<&str>, + throws: Vec, ) -> FrozenUnit { FrozenUnit::Function { docstring: String::new(), + parameters: vec![], name: name.to_string(), - synchronous: true, arguments: args, _return: ret.map(|t| KindValue::Namespaced(t.to_string(), None)), - throws: throws.into_iter().map(String::from).collect(), + throws, span: (0, 0), } } +/// A local `error`, ordinal assigned by the fixture itself (mirroring what +/// `plan_error_space` would freeze from a real schema — see +/// `core::schema::ir::compiler::interpreter::incremental`). +fn error(ordinal: u16, name: &str) -> FrozenUnit { + FrozenUnit::Error { + docstring: None, + parameters: vec![], + ordinal, + imported_from: None, + name: name.to_string(), + message: format!("{name} occurred"), + fields: vec![], + } +} + // ── fixtures ──────────────────────────────────────────────────────────────── fn primitives() -> Fixture { @@ -153,22 +168,25 @@ fn protocol() -> Fixture { Fixture { name: "protocol", namespace: "conformance", - units: vec![FrozenUnit::Protocol { - docstring: "Conformance protocol".to_string(), - parameters: vec![], - name: "Service".to_string(), - functions: vec![ - function( - "lookup", - vec![arg("id", Primitive::S32(None))], - Some("Record"), - vec!["NotFound"], - ), - function("count", vec![], Some("u64"), vec![]), - function("notify", vec![arg("code", Primitive::U16(None))], None, vec![]), - ], - span: (0, 0), - }], + units: vec![ + error(0, "NotFound"), + FrozenUnit::Protocol { + docstring: "Conformance protocol".to_string(), + parameters: vec![], + name: "Service".to_string(), + functions: vec![ + function( + "lookup", + vec![arg("id", Primitive::S32(None))], + Some("Record"), + vec![0], // ordinal of `NotFound`, above + ), + function("count", vec![], Some("u64"), vec![]), + function("notify", vec![arg("code", Primitive::U16(None))], None, vec![]), + ], + span: (0, 0), + }, + ], } }