-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
review1: feature: CtTypeParameter#getTypeErasure() #1216
Conversation
fc73605
to
bb7752f
Compare
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170311.234506-76 New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT Detected changes: 2. Change 1
Change 2
|
bb7752f
to
d3ed80d
Compare
3ce9647
to
addfd6a
Compare
addfd6a
to
059792f
Compare
To me, the type erasure is computed when the type parameter is used not defined. This means that (also could we split the discussion of |
Computing whether method A overrides method B uses type erasure. So it is not linked to CtTypeParameterReference. But we can have this method on both CtTypeParameter and CtTypeParameterReference. I personally need it on CtTypeParameter
I will check if it can be split |
Computing <https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2> whether method
A overrides method B uses type erasure. So it is not linked to CtTypeParameterReference.
I'm not sure about this. In a signature `T foo(U x)` both the return type and the parameter types
are CtType(Parameter)Reference. The method signatures don't contani CtTypeParameter directly.
|
There are two types of type erasures. Till now I though only about this case: class<A extends InputStream> {
A stream;
<B extends Reader> void setReaderLike(B reader) {}
} Such typed parameters naturally computes erasure using code on Note that
The But thanks to your note, I see now that there is another place where type erasure makes sense: class X {
void processList(List<? extends Reader> list) {};
} In this case there is no CtTypeParameter or CtTypeParameterReference involved at all. In this case we need new method So I suggest these steps:
OK? |
059792f
to
86bc395
Compare
Now this PR contains only plain Please review. Thank you! |
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-20170315.164827-83 New API: fr.inria.gforge.spoon:spoon-core:jar:5.6.0-SNAPSHOT Detected changes: 1. Change 1
|
I have to think/learn more about generics and parameters. May be you are right that CtTypeReferences has to be involved more in the Type erasure process... |
aa61e27
to
8bbef27
Compare
I have simplified computing of type erasure and I added CtTypeParameterReference#getTypeErasure too. Is such implementation OK, or did you expected something more for CtTypeParameterReference#getTypeErasure ? |
8bbef27
to
69fb080
Compare
The signature However, I'm not sure about the location. |
69fb080
to
ccb80c7
Compare
I like this idea! |
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-20170403.163958-30 New API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-SNAPSHOT Detected changes: 1. Change 1
|
Revapi Analysis resultsOld API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-20170403.191725-31 New API: fr.inria.gforge.spoon:spoon-core:jar:5.7.0-SNAPSHOT Detected changes: 1. Change 1
|
Thanks Pavel. |
Thanks Martin. |
Adds new method:
This method and #1225 are needed to correctly detect whether method overrides another method following specification