Even if they have no side effect, they aren't legal, since it would be surprising if suddenly something new got added in one which then broke the imports.
20 lines
426 B
Plaintext
20 lines
426 B
Plaintext
-- main.mcl --
|
|
import "fmt"
|
|
import "something.mcl"
|
|
|
|
print "p1" {
|
|
msg => fmt.printf("someint: %d", $something.someint),
|
|
}
|
|
-- something.mcl --
|
|
$someint = 42
|
|
class someclass {
|
|
print "p2" {
|
|
msg => "i'm inside of someclass",
|
|
}
|
|
}
|
|
|
|
# this should generate a compile error
|
|
include someclass
|
|
-- OUTPUT --
|
|
# err: errSetScope: local import of `something.mcl` failed: module contains unused statements: found stmt: include(someclass)
|