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

TypeInfo for variable type #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

TypeInfo for variable type #49

wants to merge 2 commits into from

Conversation

ZZZank
Copy link

@ZZZank ZZZank commented Dec 6, 2024

This PR adds support for TypeInfo.of(TypeVariable), allowing it to wrap type into variable type's bound, instead of TypeInfo.NONE in any cases.

To prevent infinitely parsing same type T in circular types like AAA<T extends BBB<T>>, the VariableTypeInfo will be pushed into VariableTypeInfo.CACHE before its bound is translated into TypeInfo.

For example, when translating T extends BBB<T> into TypeInfo, T will first be translated and pushed into cache, then BBB<T>, then the inner T, whose matched TypeInfo is already in the cache, breaking the loop.

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.

1 participant