forked from M-Labs/nac3
[core] codegen/expr: Add concrete ndims value to error message
This commit is contained in:
parent
69542c38a2
commit
67f42185de
@ -43,7 +43,7 @@ use super::{
|
|||||||
use crate::{
|
use crate::{
|
||||||
symbol_resolver::{SymbolValue, ValueEnum},
|
symbol_resolver::{SymbolValue, ValueEnum},
|
||||||
toplevel::{
|
toplevel::{
|
||||||
helper::{arraylike_flatten_element_type, PrimDef},
|
helper::{arraylike_flatten_element_type, extract_ndims, PrimDef},
|
||||||
numpy::unpack_ndarray_var_tys,
|
numpy::unpack_ndarray_var_tys,
|
||||||
DefinitionId, TopLevelDef,
|
DefinitionId, TopLevelDef,
|
||||||
},
|
},
|
||||||
@ -1775,10 +1775,13 @@ pub fn gen_unaryop_expr_with_values<'ctx, G: CodeGenerator>(
|
|||||||
if op == ast::Unaryop::Invert {
|
if op == ast::Unaryop::Invert {
|
||||||
ast::Unaryop::Not
|
ast::Unaryop::Not
|
||||||
} else {
|
} else {
|
||||||
|
let ndims = extract_ndims(&ctx.unifier, ty);
|
||||||
|
|
||||||
codegen_unreachable!(
|
codegen_unreachable!(
|
||||||
ctx,
|
ctx,
|
||||||
"ufunc {} not supported for ndarray[bool, N]",
|
"ufunc {} not supported for ndarray[bool, {}]",
|
||||||
op.op_info().method_name,
|
op.op_info().method_name,
|
||||||
|
ndims,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user