Files
mgmt/lang/interpret_test/TestAstFunc2/scope-lambda-printf.txtar
James Shubin c333cb542c lang: ast: Expr Param and Poly should not have values
Sometimes a recursive call through ExprVar's Value method would hit one
of these and return (nil, nil) which would throw off things.
2023-12-17 21:39:06 -05:00

13 lines
475 B
Plaintext

-- main.mcl --
import "fmt"
$format = "%d" # should get ignored
$fn = func($format) {
fmt.printf($format, 42)
}
test $fn("%s") {}
# should error at unification if possible, otherwise at runtime
# TODO: I would expect that if the "%s" and "%d" swapped, that speculatively we
# would be able to run this at compile time and know the result statically.
-- OUTPUT --
# err: errStream: func `printf@??????????` stopped before it was loaded: base kind does not match (Str != Int)