Error on first generation regarding superType [message #1792763] |
Mon, 23 July 2018 11:43  |
Eclipse User |
|
|
|
With the DSL I create a number of subclasses instead of a single class for each needed class. In the example I only created one subclass but in the real usecase for DSL there could be too many to create an own class for each one. (thats the reason why I attempt to create subclasses)
The error only appears on the first code generation. Instead of the expected
"class A extends B"
Xtext generates
"class A implements B"
After the second code generation it works as expected.
The issue appears with the "IdWithKeyElementInferrerExtension" (part of the inferrer).
With the following method I could fix the problem with the generated class(container for the subclasses) itself:
void IJvmDeclaredTypeAcceptor.accept(JvmGenericType type, Procedure1<? super JvmGenericType> lateInitialization)
acceptor.accept(
element.toClass(element.name) [
packageName = element.packageName
[...]
],
[superTypes += BaseClass.typeRef
])
But I have no clue how or if it is possible to set the inheritance reference for the subclasses in the "lateInitialization".
Example project is in the attachments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29968 seconds