Untyped variadic function types should not be permitted in strict mode
[hiphop-php.git] / hphp / hack / test / typecheck / super_constraint_2.php
blob68f7085a2f262fa59701f035858c3f3ef81e02e6
1 <?hh // strict
2 class C123<+T> {
3 private T $x;
4 public function __construct(T $x) {
5 $this->x = $x;
7 public function get(): T {
8 return $this->x;
10 public function foo<Tu super T>(Tu $x, bool $b): Tu {
11 if ($b) {
12 return $this->x;
13 } else {
14 return $x;
18 class FooBase123 {}
19 class Foo123 extends FooBase123 {}
20 class FooDerived123 extends Foo123 {}
21 class Woo {
22 public function test1(
23 C123<Foo123> $c,
24 FooDerived123 $x,
25 bool $b,
26 ): FooDerived123 {
27 return $c->foo($x, $b);