From 67f42185de653fc7a7f315dc6ae1c007bfdbda16 Mon Sep 17 00:00:00 2001 From: David Mak Date: Mon, 10 Feb 2025 10:37:55 +0800 Subject: [PATCH] [core] codegen/expr: Add concrete ndims value to error message --- nac3core/src/codegen/expr.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nac3core/src/codegen/expr.rs b/nac3core/src/codegen/expr.rs index 986ed992..cd9b87d5 100644 --- a/nac3core/src/codegen/expr.rs +++ b/nac3core/src/codegen/expr.rs @@ -43,7 +43,7 @@ use super::{ use crate::{ symbol_resolver::{SymbolValue, ValueEnum}, toplevel::{ - helper::{arraylike_flatten_element_type, PrimDef}, + helper::{arraylike_flatten_element_type, extract_ndims, PrimDef}, numpy::unpack_ndarray_var_tys, DefinitionId, TopLevelDef, }, @@ -1775,10 +1775,13 @@ pub fn gen_unaryop_expr_with_values<'ctx, G: CodeGenerator>( if op == ast::Unaryop::Invert { ast::Unaryop::Not } else { + let ndims = extract_ndims(&ctx.unifier, ty); + codegen_unreachable!( ctx, - "ufunc {} not supported for ndarray[bool, N]", + "ufunc {} not supported for ndarray[bool, {}]", op.op_info().method_name, + ndims, ) } } else {