Files
mgmt/lang/interpret_test/TestAstFunc2/import-double-star-bad.txtar
James Shubin 81b102ed7f lang: ast: Allow multiple star imports
If more than one star import is present in the same scope, allow it. If
one star import could overwrite something, ordering is not guaranteed.
We allow this for now, but we might create a compiler fix to stop it.
This adds a test to notice both of these behaviours.
2025-01-17 14:03:48 -05:00

22 lines
498 B
Plaintext

-- metadata.yaml --
#files: "files/" # these are some extra files we can use (is the default)
-- main.mcl --
# XXX: When using multiple star imports, a subsequent one may overwrite the
# earlier one. We should probably make this a compile error.
import "foo.mcl" as *
import "bar.mcl" as *
include foo("hello")
include foo("world")
-- foo.mcl --
class foo($s) {
test "foo:${s}" {}
}
-- bar.mcl --
class foo($s) {
test "bar:${s}" {}
}
-- OUTPUT --
Vertex: test[bar:hello]
Vertex: test[bar:world]