From fdc9cb2a14e83c5a344bc143f3bca7eec6e50713 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Wed, 9 Sep 2026 15:24:19 +0200 Subject: [PATCH] No assert, but return when regex haystack is not Str --- jitexpr/src/functions/regexp_extract.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jitexpr/src/functions/regexp_extract.rs b/jitexpr/src/functions/regexp_extract.rs index fe091e4da..d6876414a 100644 --- a/jitexpr/src/functions/regexp_extract.rs +++ b/jitexpr/src/functions/regexp_extract.rs @@ -95,11 +95,9 @@ impl FnCall for RegexpExtractFnCall { ) -> Result { Self::ARG_COUNT.validate(args)?; let haystack = context.apply_types(&args[0], target_type_set)?; - if haystack.return_type == VarType::None { + if haystack.return_type != VarType::Str { return Ok(TypedExpr::none()); } - assert_eq!(haystack.return_type, VarType::Str); - let UntypedExpr::Literal(Literal::String(pattern)) = &args[1] else { return Err(InvalidFunctionCall::ExpectedLiteral { argument: 2,