Basically, I want to override the parent class with different arguments. For instance:
class Hold<T> {
public var value:T;
public function new(value:T) {
set(value);
}
public function set(value:T) {
this.value = value;
}
}
Then override this class, for example:
class HoldMore extends Hold<T> {
public var value2:T;
public function new(value:T, value2:T) {
super(value);
set(value, value2);
}
override public function set(value:T, value2:T) {
this.value = value;
this.value2 = value2;
}
}
Obviously, it will return an error Field set overloads parent class with different or incomplete type. Is there any way around this? I tried to use public dynamic functionand then installed setin a function new(), but this gave a very similar error. Any thoughts?
source
share