Files
mgmt/lang/interpret_test/TestAstFunc2/scope-lambda-printf.txtar
James Shubin e10e92596f lang: types: Add stringer information manually
This lets us get the more correct lowercase versions of type kinds in
error messages. (These match what the user would type.)
2024-07-01 18:35:20 -04:00

14 lines
493 B
Plaintext

-- main.mcl --
import "fmt"
$format = "%d" # should get ignored
$fn = func($format) {
fmt.printf($format, 42)
}
$name = $fn("%s")
test "${name}" {}
# 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)