New inference: improved error message for unresolved type
[hiphop-php.git] / hphp / hack / test / typecheck / nullable_generic_good.php
blobd808d1caf2d195986667e45998444595c999e691
1 <?hh // strict
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 function coerce<T>(
5 TypeStructure<T> $ts,
6 mixed $value,
7 ): T {
8 //UNSAFE
11 function getNullableParamOfType<T>(
12 TypeStructure<T> $ts,
13 mixed $value
14 ): ?T {
15 if ($value === null) {
16 return null;
18 return coerce($ts, $value);