-
Notifications
You must be signed in to change notification settings - Fork 321
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
Xtend generates invalid code for extending dispatch method #3182
Comments
@LorenzoBettini was this introduced with your recent change or is this older |
Maybe the problem is override a method with dispatch that is not a dispatch method in the superclass and thus there are no cases |
I haven't changed the actual logic of generation. |
hmm
gives me
=> maybe this is just a follow up, is there anything in the error log @HannesWell
|
There is indeed the error below:
|
I just verified that updating the target-platform solves this issue. In order to allow working with a recent Xtext in the IDE on older Targets, I suggest to either wrap the problematic call to If you want, I can provide a fix in the beginning of next week. |
@LorenzoBettini IIRC there was a project preference that allows to skip that annotation. Ah the check is at the right location indeed: https://github.com/eclipse/xtext/pull/3080/files#diff-e64c04b0476a37cb3aa3e8d5716a3472fc4f6294ad7070eb41105500790f6db7R493 @HannesWell It should work for you if you disable that in the preferences. Can you confirm this? |
@szarnekow yes, that should help users in the same situation of @HannesWell, i.e., installing Xtend 2.36 but use an older TP. However, a check should be implemented as @HannesWell suggested: we should check whether that annotation is in the classpath. IIRC, we do a similar check for other annotations, like the standard Java |
see |
Yes I can confirm that unchecking the
Would you prefer to check the presense explicitly by for example wrapping the addition into |
+1 from me. @szarnekow @szarnekow wdyt? |
A proper guard condition sounds good to me. Please don’t catch the IAE |
Agree. I just tried to list all possibilities I could think of :) Please have a look at #3185. |
Workaround for issue in xtext code generator in xtext 2.36, see eclipse-xtext/xtext#3182. Signed-off-by: Holger Friedrich <[email protected]>
Workaround for issue in xtext code generator in xtext 2.36, see eclipse-xtext/xtext#3182. Signed-off-by: Holger Friedrich <[email protected]>
For an Xtend class that has a dispatch method, which 'extends' a dispatched method of a super-class, the generated code is faulty.
For example for
the following code is generated
The line
return; else {
causes the compiler-errorSyntax error on token "else", delete this token.
The text was updated successfully, but these errors were encountered: