Skip to content

Commit 3b4f859

Browse files
gh-165: Make IN reject non-TNS tensor.
1 parent a42a7c8 commit 3b4f859

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/builtins.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5392,9 +5392,9 @@ static Value builtin_in(Interpreter* interp, Value* args, int argc, Expr** arg_n
53925392
RUNTIME_ERROR(interp, "IN requires two arguments", line, col);
53935393
}
53945394

5395-
// Container must be a tensor; otherwise membership is false
5395+
// Container must be a tensor; otherwise this is a runtime error per spec
53965396
if (args[1].type != VAL_TNS) {
5397-
return value_bool(false);
5397+
RUNTIME_ERROR(interp, "IN expects TNS as second argument", line, col);
53985398
}
53995399

54005400
Tensor* t = args[1].as.tns;

0 commit comments

Comments
 (0)