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

Differentiate between type parameters and wildcards #212

Open
Gabriel-Darbord opened this issue Dec 22, 2023 · 0 comments
Open

Differentiate between type parameters and wildcards #212

Gabriel-Darbord opened this issue Dec 22, 2023 · 0 comments

Comments

@Gabriel-Darbord
Copy link
Member

Currently there is a single entity to represent all type parameters, including wildcards: FASTJavaTypeParameterExpression.
However, there are 2 issues with mixing both of them:

  • wildcards are only applicable on variables (not classes and methods, unlike type parameters)
  • wildcards have the additional capacity to be bounded by an upper or a lower bound, which is currently not possible to represent
class MyClass<T> {} // OK
class MyClass<?> {} // NOK

<T> void f() {} // OK
<?> void f() {} // NOK

List<T> list; // OK
List<?> list; // OK

// bounded wildcards
List<? extends MyClass> list; // upper bound
List<? super MyClass> list; // lower bound
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

No branches or pull requests

1 participant