If an auxiliary function is declared with no return type, boolean is assumed as the return type. Is it possible to declare an auxiliary function returning nothing (i.e. void)? Actually it is possible to declare and define the function as follows
Well, as a workaround I could define the auxiliary function in an external Java or Xtend class (in case of Xtend, I could even use multi dispatch). Actually, that makes me wonder why I should define auxiliary functions in the first place? Are there any interesting members which can only be accessed via the auxiliary function (and not from an external method)?
Regards,
Jens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One addition: The generated Java implementation catches exceptions and returns null in that case. This only works for declared types (Objects etc), and not for primitive types. E.g., the generated code for an auxiliary function
If an auxiliary function is declared with no return type, boolean is assumed as the return type. Is it possible to declare an auxiliary function returning nothing (i.e. void)? Actually it is possible to declare and define the function as follows
But this leads to an error in the generated code:
Well, as a workaround I could define the auxiliary function in an external Java or Xtend class (in case of Xtend, I could even use multi dispatch). Actually, that makes me wonder why I should define auxiliary functions in the first place? Are there any interesting members which can only be accessed via the auxiliary function (and not from an external method)?
Regards,
Jens
One addition: The generated Java implementation catches exceptions and returns null in that case. This only works for declared types (Objects etc), and not for primitive types. E.g., the generated code for an auxiliary function
contains compilation errors:
As a workaround, one can declare Boolean instead of boolean.
Another addition:
will result in another non-compiling code, as the generator template expects at least one parameter:
Regards,
Jens