Add static method support to methodmaps.

This commit is contained in:
David Anderson
2014-12-12 10:10:46 -08:00
parent afeae84340
commit 5b69efe5d4
9 changed files with 167 additions and 58 deletions
@@ -0,0 +1,12 @@
native printnum(t);
methodmap X
{
public int GetThing() {
return 10;
}
}
public main() {
printnum(X.GetThing());
}
@@ -0,0 +1 @@
(11) : error 176: non-static method or property 'GetThing' must be called with a value of type 'X'
@@ -0,0 +1,13 @@
native printnum(t);
methodmap X
{
public static int GetThing() {
return 10;
}
}
public main() {
X x;
printnum(x.GetThing());
}
@@ -0,0 +1 @@
(12) : error 177: static method 'GetThing' must be invoked via its type (try 'X.GetThing')
@@ -0,0 +1,12 @@
native printnum(t);
methodmap X
{
public static int GetThing() {
return 10;
}
}
public main() {
printnum(X.GetThing());
}