Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364677

Summary: Can't invoke the static methods of other classes
Product: [Modeling] TMF Reporter: Lipeng Mising name <nowind_lee>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: nowind_lee, sebastian.zarnekow
Version: 2.2.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Lipeng Mising name CLA 2011-11-24 02:30:41 EST
Build Identifier: 

I downloaded the lastest xtext 2.2.x, found it support support static methods now. So I can define a class like:

    class A {
        def static hello() {}
    }

But I can't invoke this static method from another class! It reports:

    Couldn't resolve reference to JvmIdentifiableElement 'hello'. 
    Couldn't resolve reference to JvmIdentifiableElement 'A'.

And it can't invoke a static method in a Java class.

Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-11-24 02:32:12 EST
How did you try to invoke that method?
Comment 2 Sebastian Zarnekow CLA 2011-11-24 02:36:31 EST
Btw: the expected invocation syntax would be 

A::hello
Comment 3 Moritz Eysholdt CLA 2011-11-24 09:45:03 EST
---
class Bar {
	def static hello() {}
}
---

invoked by 

---
class Foo {	
	def foo() {
		Bar::hello()
	}
}
---


works for me.