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
Stephane Galland is currently offline Stephane GallandFriend
Messages: 76
Registered: July 2014
Location: Belfort, France
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:Content assist and unordered groups
Next Topic:Serializing expressions results in an exception
Goto Forum:
  


Current Time: Mon Apr 24 09:53:09 GMT 2017

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

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