2 // Copyright 2004-present Facebook. All Rights Reserved.
5 public function f(T
$t): int;
8 final class C1
implements I1
<string> {
9 public function f(string $t): int {
15 public function __construct(private I1
<T
> $impl) {}
16 public function f(T
$t): int {
17 return $this->impl
->f($t);
22 public function BreakIt(): void
{
25 // the following line is caught by type checker
29 // What type do we expect for $c2?
30 // Perhaps C2<string>?
31 // What actually happens is
32 // $c2 : C2<v:=unresolved{}>
33 // and then check C1 <: I1<v:=unresolved{}>
34 // and so I1<string> <: I1<v:=unresolved{}>
35 // and so v:=unresolved{} <: string
37 // the following line fails in runtime
42 function main(): void
{
43 (new Foo())->BreakIt();