-
Notifications
You must be signed in to change notification settings - Fork 134
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
Implement class-level type variable safety validation #2254
Conversation
In the future, I'll implement method type variable validation as well, but this is fairly complex.
Generate changelog in
|
if (type != null && !type.getTypeArguments().isEmpty()) { | ||
List<Type> resultTypeArguments = type.getTypeArguments(); | ||
List<TypeVariableSymbol> parameterTypes = type.tsym.getTypeParameters(); | ||
if (parameterTypes.size() == resultTypeArguments.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example of where these sizes would not be equal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not, but I’ve run into cases where generic type info is missing due to compiler optimizations, so I figured it was best not to risk it.
Released 4.127.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.127.0 | Type | Description | Link | | ---- | ----------- | ---- | | Improvement | Implement class-level type variable safety validation | palantir/gradle-baseline#2254 | To enable or disable this check, please contact the maintainers of Excavator.
==COMMIT_MSG==
Implement class-level type variable safety validation
==COMMIT_MSG==
In the future, I'll implement method type variable validation
as well, but this is fairly complex.