Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364677 - Can't invoke the static methods of other classes
Summary: Can't invoke the static methods of other classes
Status: CLOSED WORKSFORME
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.2.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-24 02:30 EST by Lipeng Mising name CLA
Modified: 2011-11-24 09:45 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.