method ref: introduce method ref variable; accept method ref type separately

This commit is contained in:
anna
2012-09-25 19:47:03 +02:00
parent 97b9fbee9a
commit 71eb8ec93e
6 changed files with 44 additions and 1 deletions
@@ -0,0 +1,15 @@
class Test {
{
Bar c = Test::length;
bar(c);
}
public static Integer length(String s) {
return s.length();
}
static void bar(Bar bar) {}
interface Bar {
Integer _(String s);
}
}
@@ -0,0 +1,14 @@
class Test {
{
bar(<selection>Test::length</selection>);
}
public static Integer length(String s) {
return s.length();
}
static void bar(Bar bar) {}
interface Bar {
Integer _(String s);
}
}