-
Notifications
You must be signed in to change notification settings - Fork 53
name clash with lambda as anon inner class compilation #1301
Comments
no no clue what change could have caused this. unfortunately not too many people seem to test milestones :( |
workaround:
having
causes the problem am not sure if this is a problem in the gradle plugin |
config.getJavaSourceVersion().isAtLeast(JAVA8) is false the pref has i thought this was fixed in the plugin.... |
I noticed the workaround you suggested shortly before you posted it. However, it seems the |
yes this is a bug in xtext-gradle-plugin |
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
can you build this branch locally and test it (you may need to delete existing xtend and xtext.java prefs) |
I still think there is also an Xtend generator component to it. Setting aside the failure to identify the correct Java compliance level, the correctly-generated code has a lambda with I'm also seeing a lot of weirdness with the |
yes it also should work conflict free with anonymous inner classes |
if you want an opt out for useJavaCompilerCompliance or settings generation, |
i have no clue why we dont get the settings configured in e.g. xtext-core codebase |
@dpetroff any update? |
@rubenporras the anonymous class has name clash issue would be something for you to look at if you want to dive into xbase |
Hi @cdietrich , why do you think it would be something for me? do you think a PR I merged in Xtext 2.25 could have broke something or do you think I could be interested in the topic? Regards |
i am actually asking if you are ... |
Hi @cdietrich , thanks for asking. No, currently I am not interested. I am focused in migrating from xtext eclipse to xtext lsp, and that is enough of a challenge. In addition, we use Maven for our projects. |
[eclipse/xtext-xtend#1301] fix targetJavaVersion preference
gradle plugin is fixed. |
@szarnekow
|
should or should |
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
alternatively: should the extension on out scope variable visible here? |
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
[eclipse/xtext-xtend#1301] fix name clashes with anony. inner classes
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
[#1301] fix name clashes with anony. inner classes
fixed |
Today I upgraded from Xtend 2.21 to 2.26 and my code base broke the IDE generator targeting Java 11.
Consider the method
In the most recent Eclipse package (2022-03), the IDE generator generates distinctly different code from gradle for this example. In particular, the gradle generator uses Java lambda notation, while the IDE does not. Additionally, the IDE generated code also results in broken Java because it does not disambiguate between the
EObject it
and theAdapter it
inside the lambda. Notice that theEObject it
is declared as an extension, so theeAdapters
call inside the lambda should apply to it. This works as expected when building with gradle and previous versions of the IDE, but the current IDE generator does not appear to disambiguate between the twoit
s, which results in broken Java code.myGradleProject.zip is a minimal gradle project reproducing the issue. Note that building with gradle is successful, including the test phase, and as long as the IDE generator doesn't rebuild the source after refreshing the gradle project in the IDE, there are no errors in the editor. Once the IDE has rebuilt the source, it is necessary to rebuild again with gradle and refresh the gradle project in the IDE again to get rid of the error.
The text was updated successfully, but these errors were encountered: