Found while writing negative goldens for #446.
-
std.range(-1) panics the evaluator: makeslice: len out of range at eval.go:1290. A user typo in a range bound crashes scampi instead of raising a diagnostic. Needs a typed error (negative count) or clamp-to-empty, plus a golden.
-
std.env("X", "") treats an explicit empty-string default as no default: the fallback check is def != "", so passing "" still errors with EnvVarNotSet. An explicit default should win regardless of value. Needs a presence-based check (arity) instead of a sentinel comparison.
Both are golden-testable once fixed (testdata/eval/errors_runtime/ for the first, a happy-path eval fixture for the second).
Found while writing negative goldens for #446.
std.range(-1) panics the evaluator:
makeslice: len out of rangeat eval.go:1290. A user typo in a range bound crashes scampi instead of raising a diagnostic. Needs a typed error (negative count) or clamp-to-empty, plus a golden.std.env("X", "") treats an explicit empty-string default as no default: the fallback check is
def != "", so passing "" still errors with EnvVarNotSet. An explicit default should win regardless of value. Needs a presence-based check (arity) instead of a sentinel comparison.Both are golden-testable once fixed (testdata/eval/errors_runtime/ for the first, a happy-path eval fixture for the second).