Community
Participate
Working Groups
Build Identifier: 201104061304 I have the following Xtend dispatch function: dispatch labelName(AbstractSection aS){ aS.eContainer().labelName() + "-" } dispatch labelName(Object any){ "" } The editor complains here: Couldn't resolve reference to JvmIdentifiableElement '+'. Also the whole function "labelName(AbstractSection aS)" is evaluated to be of type void, which is actually not the case. Reproducible: Always
Because there is a recursion involved, you need to explicitly declare the return type (defaults to Object). We need to add a validation.
Preliminary scheduled for 2.0RC1
postponed to SR1
*** Bug 352706 has been marked as a duplicate of this bug. ***
If we want to solve this for all cases, this requires a significant amount of static code analysis which is not yet there. Postponed.
Partially valid. Actually: - return type is now Object instead of void - we have validation (warning message) Should: - return type should be String Example: dispatch def labelName(EObject eObj) {// WARNING eObj.eContainer.labelName() + "_" } dispatch def labelName(Object obj) { //WARNING "" } def test342173() { val eObj = EcoreFactory::eINSTANCE.createEObject val String str = eObj.labelName() //ERROR }
*** This bug has been marked as a duplicate of bug 404817 ***