From a2a28f8d23a46ba1696b6a8410d4d3b5c1808f49 Mon Sep 17 00:00:00 2001 From: "sorokin.oleg.edu" Date: Sat, 12 Sep 2026 23:50:33 -0700 Subject: [PATCH] Use an anonymous dimension in the AsKind lowering oracle --- .../language/analysis_source/lower/tests.rs | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/crates/oa-core/src/language/analysis_source/lower/tests.rs b/crates/oa-core/src/language/analysis_source/lower/tests.rs index 2f8e10cd..89ef442c 100644 --- a/crates/oa-core/src/language/analysis_source/lower/tests.rs +++ b/crates/oa-core/src/language/analysis_source/lower/tests.rs @@ -266,13 +266,23 @@ fn all_thirteen_expression_variants_lower_to_real_typed_values_and_admit() { numeric.clone(), ), ( - "as_kind(@duration, 1 [@second])", + "as_kind(@duration, power(1 [@second], 2) / 1 [@second])", a::Expr::AsKind { kind: a::DefinitionRef::Local(duration), - value: Box::new(a::Expr::Quantity { - magnitude: Exact::from_integer(1), - unit: a::DefinitionRef::Local(second), - }), + value: Box::new(binary( + a::BinaryOp::Divide, + a::Expr::Power { + base: Box::new(a::Expr::Quantity { + magnitude: Exact::from_integer(1), + unit: a::DefinitionRef::Local(second), + }), + exponent: 2, + }, + a::Expr::Quantity { + magnitude: Exact::from_integer(1), + unit: a::DefinitionRef::Local(second), + }, + )), }, quantity.clone(), ), @@ -685,6 +695,10 @@ fn ordinary_non_element_categories_are_collected_and_never_property_fallbacks() fn structural_lowering_defers_type_purity_layer_and_argument_sets_to_admission() { for (old, new) in [ ("base 750 [@millisecond]", "base true"), + ( + "base 750 [@millisecond]", + "base as_kind(@duration, 1 [@second])", + ), ("body $a + $b", "body @receive_time"), ("a: @receive_time, b: @dispatch_time", "a: @receive_time"), ("oa_property receive_time", "sa_property receive_time"),