Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

vudaltsov
Copy link
Member

@vudaltsov vudaltsov commented Jan 27, 2024

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
public readonly AtMethod|AtClass|AtFunction $declaredAt;

public readonly Type $constraint;

/**
* @internal
* @psalm-internal Typhoon\Type
* @param non-empty-string $name
*/
Copy link
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

@@ -369,9 +372,34 @@ public static function valueOf(Type $type): ValueOfType
* @psalm-pure
* @param non-empty-string $name
*/
Copy link
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
1 of 5 checks passed
@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