Files
mgmt/lang/interpret_test/TestAstFunc2/printfinterpolate0/main.mcl
James Shubin a0c909914d lang: funcs: Don't allow interpolation in printf format string
We'd like to pre-compute the interpolation if we can, so that we can run
this code properly... For now, we can't so it's a compile time error...
Hopefully we can remove this restriction in the future. The problem is
the string must be a constant, or it would be possible to switch it from
"%d %s" to "%s %d %d" or anything that changes the type signature.
2019-03-09 18:06:18 -05:00

11 lines
268 B
Plaintext

import "fmt"
$str1 = "big"
$str2 = "world"
# FIXME: we'd like to pre-compute the interpolation if we can, so that we can
# run this code properly... for now, we can't, so it's a compile time error...
print "print1" {
msg => fmt.printf("hello ${str1} %s", $str2),
}