From c407622f5ce1cfc4a96d3ae2d73ebe7dcf1fdddc Mon Sep 17 00:00:00 2001 From: David Mak Date: Tue, 20 Aug 2024 11:29:51 +0800 Subject: [PATCH] [core] codegen/expr: Add compilation error for unsupported cmpop --- nac3core/src/codegen/expr.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nac3core/src/codegen/expr.rs b/nac3core/src/codegen/expr.rs index 15e73cbb..8497286f 100644 --- a/nac3core/src/codegen/expr.rs +++ b/nac3core/src/codegen/expr.rs @@ -2208,7 +2208,10 @@ pub fn gen_cmpop_expr_with_values<'ctx, G: CodeGenerator>( ctx.ctx.bool_type().get_poison() } else { - unimplemented!() + return Err(format!("'{}' not supported between instances of '{}' and '{}'", + op.op_info().symbol, + ctx.unifier.stringify(left_ty), + ctx.unifier.stringify(right_ty))) }; Ok(prev?.map(|v| ctx.builder.build_and(v, current, "cmp").unwrap()).or(Some(current)))