Files
mgmt/lang/interpret_test/TestAstFunc1/importscope0/second.mcl
James Shubin 806d2f6a4a lang: Fix import scoping issue with classes
When include-ing a class, we propagated the scope of the include into
the class instead of using the correct scope that existed when the class
was defined and instead propagating only the include arguments in.

This patch fixes the issue and adds a ton of tests as well. It also
propagates the scope into the include args, in case that is needed, and
adds a test for that as well.

Thanks to Nicolas Charles for the initial bug report.
2019-04-21 19:49:38 -04:00

13 lines
208 B
Plaintext

import "os"
import "fmt"
class xclass {
#import "os" # this should not be required, top-level should be enough
$aaa = if os.is_debian() { "bbb" } else { "ccc" }
print "${aaa}" {
msg => "hello",
}
}