Hello, I’m trying to override the function hello() from the Test2 class and I am running into the error “Cannot rebind this method : please use ‘dynamic’ before method declaration” and I’m not sure where exactly I should place it.
Here is my sample code
class Test {
static function main() {
var t = new Test2();
t.hello = (p) -> {
trace(p);
};
t.hello("Foo bar");
}
}
And this is Test2
class Test2 {
public function hello(p:String) {}
public function new() {}
}