Can someone explain why I cannot inline a method call from the superclass when using the type parameter?
class Event {}
class Dispatcher<TEvent:Event> {
private function dispatchObject(event:TEvent) {}
}
class SomeEvent extends Event {
public function new() {}
}
class SomeDispatcher extends Dispatcher<SomeEvent> {
public function new() {}
public function dispatch():Void {
dispatchObject(new SomeEvent()); // It`s OK
inline dispatchObject(new SomeEvent()); // SomeEvent should be Dispatcher.TEvent
inline dispatchObject(cast new SomeEvent()); // error: Dispatcher.TEvent should be SomeEvent
var event:Dynamic = new SomeEvent();
inline dispatchObject(event); // It`s OK
}
}