diff --git a/R/data.table.R b/R/data.table.R index 082ce2fdd0..b5fcfd3479 100644 --- a/R/data.table.R +++ b/R/data.table.R @@ -686,10 +686,7 @@ replace_dot_alias = function(e) { if (is.null(jsub)) return(NULL) if (!with) { - if (jsub %iscall% ":=") { - # TODO(>=1.18.0): Simplify this error - stopf("with=FALSE together with := was deprecated in v1.9.4 released Oct 2014; this has been warning since v1.15.0. Please wrap the LHS of := with parentheses; e.g., DT[,(myVar):=sum(b),by=a] to assign to column name(s) held in variable myVar. See ?':=' for other examples.") - } + if (jsub %iscall% ":=") stopf("`:=` is only supported under with=TRUE, see ?`:=`.") # missingby was already checked above before dealing with i if (jsub %iscall% c("!", "-") && length(jsub)==2L) { # length 2 to only match unary, #2109 notj = TRUE diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 070f76fa2d..2b775cc367 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -4629,7 +4629,7 @@ test(1241, DT[order(x,-y)], # optimized to forder() DT = data.table(a=1:3, b=4:6) myCol = "a" -test(1242.1, DT[2,myCol:=6L,with=FALSE], error="with=FALSE together with := was deprecated in v1.9.4") +test(1242.1, DT[2,myCol:=6L,with=FALSE], error="`:=` is only supported under with=TRUE.") test(1242.2, DT[2,(myCol):=7L], data.table(a=INT(1,7,3), b=4:6)) # consistency of output type of mult, #340 @@ -13930,7 +13930,7 @@ test(1967.42, x[3, rollends = rep(TRUE, 10L)], error = 'rollends must be length test(1967.43, x[ , ..], error = 'symbol .. is invalid') test(1967.44, x[NULL], data.table(NULL)) test(1967.45, x[ , NULL], NULL) -test(1967.46, x[ , 'b' := 6:10, with=FALSE], error='with=FALSE together with :=') +test(1967.46, x[ , 'b' := 6:10, with=FALSE], error='`:=` is only supported under with=TRUE.') x[, b := 6:10] test(1967.47, x[ , -1L, with = FALSE], data.table(b = 6:10)) test(1967.48, x[ , b, .SDcols = 'a'], 6:10,