I was trying to figure out how to implement a Visitor pattern in Hack. It obviously requires function-overloading polymorhism, but as I have tested, this examle:
<?hh // strict
class Visitor {
public function visit(string $s) : void {}
public function visit(int $i) : void {}
}
produces the usual PHP's
Fatal error: Redeclared method Visitor::visit in hh-polymorphism.php on line 4
And since this failed, then I would like to ask if there are plans to support this in future? Or are there any factors that would prevent this from being implemented?