No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / typehole / T62211996.php
blob5a3739b94103cc9c9f8607cde67096fe17248581
1 <?hh
2 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
4 final class ReifyTest<<<__Enforceable>> reify T> {
5 public function __construct(private T $val) {}
6 public function foo(mixed $other): T {
7 $other as this;
8 return $other->val;
12 <<__EntryPoint>>
13 function breakit(): void {
14 $x = new ReifyTest<int>(42);
15 $x->foo(new ReifyTest<string>('bar'));