Fixed the close over methods and member vars bug, but there's something remaining causing the safe_recursive_delete not to work. Gotta save progress and do other stuff
This commit is contained in:
27
tests/test_close_over_members.krak
Normal file
27
tests/test_close_over_members.krak
Normal file
@@ -0,0 +1,27 @@
|
||||
import io:*
|
||||
|
||||
fun runFunc(func: fun():void) {
|
||||
func()
|
||||
}
|
||||
|
||||
obj ToClose {
|
||||
var data: int
|
||||
fun print4() {
|
||||
println(4)
|
||||
}
|
||||
fun testMethod() {
|
||||
runFunc(fun() { print4(); } )
|
||||
}
|
||||
fun testVariable() {
|
||||
data = 7
|
||||
runFunc(fun() { println(data); } )
|
||||
}
|
||||
}
|
||||
|
||||
fun main():int {
|
||||
var it: ToClose
|
||||
it.testMethod()
|
||||
it.testVariable()
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user