Superclass calls in closures.

This commit is contained in:
Bob Nystrom
2013-12-22 20:46:12 -08:00
parent 3c8b4c009f
commit ad1fcf66bc
2 changed files with 60 additions and 42 deletions
+16
View File
@@ -0,0 +1,16 @@
class Base {
toString { return "Base" }
}
class Derived is Base {
getClosure {
return fn {
return super.toString
}
}
toString { return "Derived" }
}
var closure = (new Derived).getClosure
IO.write(closure.call) // expect: Base