-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.12.x' into 2.0.x
- Loading branch information
Showing
4 changed files
with
47 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
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,34 @@ | ||
<?php | ||
|
||
namespace Bug11899; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
abstract class Test {} | ||
|
||
interface InvertedQuestions {} | ||
|
||
class SomeTest extends Test implements InvertedQuestions {} | ||
|
||
/** | ||
* @template TTestType = Test | ||
* @property-read ?TTestType $test | ||
*/ | ||
class UserTest { | ||
public function __get() : mixed { | ||
return new SomeTest(); | ||
} | ||
} | ||
|
||
function acceptUserTest1(UserTest $ut) : void { | ||
assertType('Bug11899\\UserTest', $ut); | ||
assertType('Bug11899\\Test|null', $ut->test); | ||
} | ||
|
||
/** | ||
* @param UserTest<InvertedQuestions> $ut | ||
*/ | ||
function acceptUserTest2(UserTest $ut) : void { | ||
assertType('Bug11899\\UserTest<Bug11899\\InvertedQuestions>', $ut); | ||
assertType('Bug11899\\InvertedQuestions|null', $ut->test); | ||
} |