From 78eaa6aab9932d661cc2929c21f1544d9017a0e5 Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Wed, 9 Oct 2024 20:22:23 +0100 Subject: [PATCH] Fix logic error in shadow test --- R/dsl-parse.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/dsl-parse.R b/R/dsl-parse.R index 02577c3b..6968266d 100644 --- a/R/dsl-parse.R +++ b/R/dsl-parse.R @@ -117,9 +117,9 @@ dsl_parse_check_fixed <- function(exprs, fixed, call) { } name <- vcapply(exprs, "[[", "name") - err <- match(name, names(fixed)) - if (length(err) > 0) { - eq <- exprs[[err[[1]]]] # just first is easiest to report on + err <- name %in% names(fixed) + if (any(err)) { + eq <- exprs[[which(err)[[1]]]] dsl_parse_error( "Value '{eq$name}' in 'fixed' is shadowed by {eq$type}", "E207", eq$expr, call)