Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Method not found in enclosing type
Method not found in enclosing type [message #1756172] Mon, 13 March 2017 12:42
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
I have an issue when I want to include anonymous class definition in my DSL.

When I wrote the following code, it is compiling:
class XXX {
  protected def setMouseTargetOnScreen(obj : Object) : void {
  }
  new {
    new MouseMotionListener {
      override mouseDragged(e : MouseEvent) {
      }
      override mouseMoved(e : MouseEvent) {
         XXX.this.setMouseTargetOnScreen(new Object)
      }
    }
  }
}


When I move the function definition after the constructor definition, I obtain the error "The method setMouseTargetOnScreen() is undefined in type XXX".
class XXX {
  new {
    new MouseMotionListener {
      override mouseDragged(e : MouseEvent) {
      }
      override mouseMoved(e : MouseEvent) {
         XXX.this.setMouseTargetOnScreen(new Object)
      }
    }
  }
  protected def setMouseTargetOnScreen(obj : Object) : void {
  }
}


Is something encountered this issue, or give me a starting point for debugging?

My DSL override a part of Xtend.
I have defined my grammar here.
The JVM model inferrer is defined here.

The reentrant type resolver is defined here.
Previous Topic:Default behaviour changed from AbstractDeclarativeFormatter to AbstractFormatter2?
Next Topic:2 OutputConfiguration's on Idea with Error
Goto Forum:
  


Current Time: Sun Dec 01 17:46:18 GMT 2024

Powered by FUDForum. Page generated in 0.04714 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top