Closed natebrunette closed 6 years ago
At run-time, this would probably effectively mean:
class Test
{
private $box: Box<int>;
public function setBox(Box<mixed> $box)
{
$this->box = $box;
}
}
The assumption here being that Box
must necessarily have a default type-argument - otherwise, type-hinting as just Box
wouldn't be valid.
What happens when you try to set a generic type property to a non-generic type?