Files
mgmt/lang/interpret_test/TestAstFunc2/unify-interpolate-edge1-pass.txtar
James Shubin 946468dc99 lang: ast: Ensure a list doesn't sneak through type interpolation
If we had a single list wrapped in an interpolated string, it could
sneak through type unification, which is not correct. Wrapping a
variable by interpolation in a string, must force it to be a string.
2024-03-20 18:36:47 -04:00

17 lines
409 B
Plaintext

-- main.mcl --
$name = ["a", "bb", "ccc",]
test $name {}
test "test" {}
Test[$name] -> Test["test"] # must pass
#Test["${name}"] -> Test["test"] # must fail
-- OUTPUT --
Edge: test[a] -> test[test] # test[a] -> test[test]
Edge: test[bb] -> test[test] # test[bb] -> test[test]
Edge: test[ccc] -> test[test] # test[ccc] -> test[test]
Vertex: test[a]
Vertex: test[bb]
Vertex: test[ccc]
Vertex: test[test]