summaryrefslogtreecommitdiffstats
authorMoritz Eysholdt2011-11-15 09:24:40 (EST)
committer Dennis Huebner2011-11-16 05:12:40 (EST)
commit9dfcdb8c181af6bea186951b07d63f9ca6a083ac (patch) (side-by-side diff)
tree46ce16fd2ab9f56c0b25856b1f28f145e667d827
parentfcdf23b0f9a97f66f57f507cab9449485d804302 (diff)
downloadorg.eclipse.xtend-9dfcdb8c181af6bea186951b07d63f9ca6a083ac.zip
org.eclipse.xtend-9dfcdb8c181af6bea186951b07d63f9ca6a083ac.tar.gz
org.eclipse.xtend-9dfcdb8c181af6bea186951b07d63f9ca6a083ac.tar.bz2
[xtend] allow to use local static methods as extension methods
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--tests/org.eclipse.xtext.xtend2.tests/src/org/eclipse/xtext/xtend2/tests/compiler/CompilerTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/org.eclipse.xtext.xtend2.tests/src/org/eclipse/xtext/xtend2/tests/compiler/CompilerTest.java b/tests/org.eclipse.xtext.xtend2.tests/src/org/eclipse/xtext/xtend2/tests/compiler/CompilerTest.java
index 949b1a7..1849a14 100644
--- a/tests/org.eclipse.xtext.xtend2.tests/src/org/eclipse/xtext/xtend2/tests/compiler/CompilerTest.java
+++ b/tests/org.eclipse.xtext.xtend2.tests/src/org/eclipse/xtext/xtend2/tests/compiler/CompilerTest.java
@@ -2366,6 +2366,14 @@ public class CompilerTest extends AbstractXtend2TestCase {
invokeAndExpect2(43, "def foo() { bar + 1 } def static bar() { 42 }", "foo");
}
+ public void testStaticExtensionStaticCall() throws Exception {
+ invokeAndExpectStatic(43, "def static foo() { 42.bar } def static bar(int x) { x + 1 }", "foo");
+ }
+
+ public void testStaticExtensionDynamicCall() throws Exception {
+ invokeAndExpect2(43, "def foo() { 42.bar } def static bar(int x) { x + 1 }", "foo");
+ }
+
public void testStaticFieldStaticCall() throws Exception {
invokeAndExpectStatic(42, "static int bar def static foo() { bar = 42; bar }", "foo");
}