-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Review: fix order of type members #1787
Review: fix order of type members #1787
Conversation
@pvojtechovsky I'll have a look on it |
@pvojtechovsky for me it's fixed, but it's interesting: I may have catch another bug with it :) The test IBurritos<?, ?> burritos = new Burritos<>(); // isGenerics: false
Tacos<K, String>.Burritos<K, V> burritos; // isGenerics: true Do you know if it's an expected behaviour that when a wildcard is used it's not considered as generic? I can just change the test by renaming the variable but I want to be sure it's not another bug here :) |
Yes, it is the expected behavior. |
@surli, thank You for you effort! But I would prefer different solution ;-) In the code generation stuff I am doing now, I need these contracts:
I added failing test for the case (2). And I would prefer solution which will fit to (3) too. So the best would be |
looking at this one. we have worked on this some time ago. I'm pretty sure this is a regression due to a missing test. |
can I force-push here to have a clean diff? (you won't loose anything?) |
yes, you can force push there. I am not working on that, because I do not know how to do it well. My only work here is showing the problem with test cases |
And the solution for this problem I still needed for correct implementation of new Patterns. So please give it some time - at least for a discussion of a concept how it should behave correctly. |
fbf0df6
to
6dd6f07
Compare
Here is the fix. The problem was due to two factors:
This PR fixes it (and protects OK to merge? |
|
Yes, But is this a bug in What is sure is that the current behavior fits our needs (unless we come up with a failing test case). |
It is true that all Spoon code uses |
let's merge it then. this was a real bug! |
This test shows that order of type members is not the same like they are in source file.
@tdurieux, @monperrus , @surli , I actually do not know how to fix it - probably an CtTypeImpl#sortTypeMembers() might be called at some good place in SpoonJDTCompiler code ?
goal is to fix #1857