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

Bug 365074

Summary: [Xtend] static methods may not call instance extension methods
Product: [Modeling] TMF Reporter: Holger Schill <Holger.Schill>
Component: XtextAssignee: Moritz Eysholdt <moritz.eysholdt>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: sven.efftinge
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: M4   
Hardware: All   
OS: All   
Whiteboard:

Description Holger Schill CLA 2011-11-29 10:25:28 EST
Steps to reproduce:

class Foo { 
  	extension Test a
	def static bar(){
		"42".foo
	}
}

If the class Test has a non static method foo(String a) the code above will lead to the following invalid java:

@SuppressWarnings("all")
public class Foo {
  private Test a;
  
  public static String bar() {
    String _foo = this.a.foo("42");
    return _foo;
  }
}
Comment 1 Holger Schill CLA 2011-11-29 10:36:57 EST
There is also contentAssist for this.
Comment 2 Moritz Eysholdt CLA 2011-12-01 06:12:57 EST
fixed. pushed to 'master'.
Comment 3 Karsten Thoms CLA 2017-09-19 17:31:20 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:42:30 EDT
Closing all bugs that were set to RESOLVED before Neon.0