-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TemplateTypeCheck tries to resolve template type names such as
self
…
… because they're not usable
- Loading branch information
1 parent
eb39381
commit c6fad64
Showing
8 changed files
with
63 additions
and
1 deletion.
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
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,41 @@ | ||
<?php // lint >= 8.1 | ||
|
||
namespace Bug10049; | ||
|
||
/** | ||
* @template SELF of SimpleEntity | ||
*/ | ||
abstract class SimpleEntity | ||
{ | ||
/** | ||
* @param SimpleTable<SELF> $table | ||
*/ | ||
public function __construct(protected readonly SimpleTable $table) | ||
{ | ||
} | ||
} | ||
|
||
/** | ||
* @template-covariant E of SimpleEntity | ||
*/ | ||
class SimpleTable | ||
{ | ||
/** | ||
* @template ENTITY of SimpleEntity | ||
* | ||
* @param class-string<ENTITY> $className | ||
* | ||
* @return SimpleTable<ENTITY> | ||
*/ | ||
public static function table(string $className, string $name): SimpleTable | ||
{ | ||
return new SimpleTable($className, $name); | ||
} | ||
|
||
/** | ||
* @param class-string<E> $className | ||
*/ | ||
private function __construct(readonly string $className, readonly string $table) | ||
{ | ||
} | ||
} |