-
Notifications
You must be signed in to change notification settings - Fork 95
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
Quickfix for return type that's a wildcard doesn't work post 1.4 #1558
Comments
I started working on this; doing 1. is pretty easy, doing 2. is a bit more involved. |
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 30, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
3 tasks
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 30, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 31, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 31, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 31, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 31, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
datho7561
added a commit
to datho7561/eclipse.jdt.ui
that referenced
this issue
Jul 31, 2024
The old method would propose the erasure of the type param if the compliance was set pre 1.5. If the compliance Instead, now two quickfixes are always propose: 1. Replace the return type with the erasure 2. Introduce a new type param with the same bounds, importing the bounds and adding the type variable for any raw types Fixes eclipse-jdt#1558 Signed-off-by: David Thompson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The quickfix to fix the return type in the following code doesn't work.
It's a particular nasty edge case: this anonymous class inherits a method that has a method-level type parameter with a bound set, and the return type is that type variable. (see the javadoc for AccessibleObject.getAnnotation)
Pre-1.5, the erasure of the type variable is calculated as the value that
void
gets replaced with. Post 1.5, the type variable is inserted in place ofvoid
, which results in invalid code, since the type variable is declared in the override implementation.I think that ideally this quickfix should provide two options:
The text was updated successfully, but these errors were encountered: