Debian Codegraph @

lang/interpret_test/TestAstFunc1/unused1.txtar

raw
1 -- main.mcl --
2 import "fmt"
3 import "something.mcl"
4
5 include something.someclass
6 print "p1" {
7 msg => fmt.printf("someint: %d", $something.someint),
8 }
9 -- something.mcl --
10 $someint = 42
11 class someclass {
12 print "p2" {
13 msg => "i'm inside of someclass",
14 }
15 }
16
17 # this should generate a compile error
18 print "unused" {
19 msg => "i'm unused because i'm inside an imported module",
20 }
21 -- OUTPUT --
22 # err: errSetScope: import scope `something.mcl` failed: local import of `something.mcl` failed: module contains unused statements: found stmt: res(print)