Skip to content

Reverted declaration sites for TemplateType and StaticType, added constraint to TemplateType - #25

Merged
vudaltsov merged 2 commits into
0.3.xfrom
static-type-declaring-class
Jan 28, 2024
Merged

Reverted declaration sites for TemplateType and StaticType, added constraint to TemplateType#25
vudaltsov merged 2 commits into
0.3.xfrom
static-type-declaring-class

Conversation

@vudaltsov

@vudaltsov vudaltsov commented Jan 27, 2024

Copy link
Copy Markdown
Member

This is reverted due to discussion in https://www.youtube.com/live/DcObNIRECdc?si=SgeXDe80tCieUAmA&t=903.

Basically, keeping track of declaration site will allow (hopefully) to validate passed types without any additional context.

@vudaltsov
vudaltsov force-pushed the static-type-declaring-class branch from 6d0ac27 to 83ef99a Compare January 27, 2024 23:15
@vudaltsov vudaltsov changed the title Reverted StaticType $declaringClass Reverted declaration sites for TemplateType and StaticType, added constraint to TemplateType Jan 27, 2024
Comment thread src/TemplateType.php
* @internal
* @psalm-internal Typhoon\Type
* @param non-empty-string $name
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param Type<TType> $constraint

Comment thread src/types.php
@@ -369,9 +372,34 @@ public static function valueOf(Type $type): ValueOfType
* @psalm-pure
* @param non-empty-string $name
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@template TType
@param Type<TType> $constraint
@return TemplateType<TType>

@vudaltsov
vudaltsov merged commit 2d58b9e into 0.3.x Jan 28, 2024
@vudaltsov
vudaltsov deleted the static-type-declaring-class branch January 28, 2024 19:01
@alies-dev
alies-dev removed their request for review October 23, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants