-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed inferring template types from ThisType
- Loading branch information
1 parent
8f0150d
commit a843d87
Showing
3 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Bug4725; | ||
|
||
use function PHPStan\Analyser\assertType; | ||
|
||
class Application_Model_Ada extends Clx_Model_Abstract {} | ||
|
||
abstract class Clx_Model_Abstract {} | ||
|
||
/** | ||
* @template T of Clx_Model_Abstract | ||
*/ | ||
abstract class Clx_Model_Mapper_Abstract | ||
{ | ||
} | ||
|
||
|
||
/** | ||
* @template T of Clx_Model_Abstract | ||
*/ | ||
class Clx_Paginator_Adapter_Mapper | ||
{ | ||
/** | ||
* @phpstan-param Clx_Model_Mapper_Abstract<T> $mapper | ||
*/ | ||
public function __construct(Clx_Model_Mapper_Abstract $mapper) | ||
{ | ||
} | ||
|
||
/** @return T */ | ||
public function getT() | ||
{ | ||
|
||
} | ||
} | ||
|
||
/** | ||
* @template T of Application_Model_Ada | ||
* @extends Clx_Model_Mapper_Abstract<T> | ||
*/ | ||
class ClxProductNet_Model_Mapper_Ada extends Clx_Model_Mapper_Abstract | ||
{ | ||
|
||
public function x() { | ||
$map = new Clx_Paginator_Adapter_Mapper($this); | ||
assertType('Bug4725\Clx_Paginator_Adapter_Mapper<T of Bug4725\Application_Model_Ada (class Bug4725\ClxProductNet_Model_Mapper_Ada, argument)>', $map); | ||
assertType('T of Bug4725\Application_Model_Ada (class Bug4725\ClxProductNet_Model_Mapper_Ada, argument)', $map->getT()); | ||
} | ||
} |