Community
Participate
Working Groups
Build Identifier: Currently (2.2 nightly) this method creates a JvmOperation for an attribute setter with null returnType. This will crash the XBaseCompiler if e.g. this JvmOperation is used as last argument in a XBlockExpression. My workaround is: // TODO restore if xtext works here! We need to have void type for this method! members += x.toSetter( x.varName, t ) val setter = x.toSetter( x.varName, t ) setter.returnType = typeRefs.getTypeForName( typeof( Void ), x ) members += setter Reproducible: Always
sorry, the above code is confusing, here is the pure workaround from my JvmModelInferrer: // TODO We need to have void type for this method! val setter = x.toSetter( x.varName, t ) setter.returnType = typeRefs.getTypeForName( typeof( Void ), x ) members += setter
one more thing... ;-) of course the primitive void should be used! so: setter.returnType = typeRefs.getTypeForName( Void::TYPE, x ) is correct in my example case.
In Xtext 2.3 I see that the void type is correctly set, so closing this old one...
Thank you, for verifying :-)