mirror of
https://github.com/danog/Valinor.git
synced 2024-11-30 04:39:05 +01:00
7a49f45175
This is mostly to include type inference in regression tests: out-of-the box type inference for 99% of usages is based on `TreeMapper#map(class-string<T>, mixed): T`, and it is worth preserving that behavior without the need of plugins. This test covers that.
15 lines
314 B
PHP
15 lines
314 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace CuyZ\Valinor\Tests\StaticAnalysis;
|
|
|
|
use CuyZ\Valinor\Mapper\TreeMapper;
|
|
use CuyZ\Valinor\Tests\StaticAnalysis\Stub\A;
|
|
|
|
/** @param mixed $input */
|
|
function mappingClassWillInferObjectOfSameType(TreeMapper $mapper, $input): A
|
|
{
|
|
return $mapper->map(A::class, $input);
|
|
}
|