No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / typehole / T46965643.php
blob99334a0a2df5479b307566b4c4956bad8e183f84
1 <?hh
2 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
4 interface I1 {
5 public function takes_t<T>(T $v): void;
8 class C1<T> implements I1 {
9 public function __construct(
10 public (function(T): void) $checkFn,
11 ): void {}
13 public function takes_t(T $v): void {
14 $check_fn = $this->checkFn;
15 $check_fn($v);
19 function takes_i1(I1 $i): void {
20 $i->takes_t("foo");
23 <<__EntryPoint>>
24 function create_c1(): void {
25 $c = new C1((int $_) ==> {}); // inferred as C1<nothing>
26 takes_i1($c);