porting one of my libraries I have come around a IMHO serious issue.
Please see the following code:
Code: Select all
using System
function Start( ) as void
Console.WriteLine("Hello x#!")
MyClass{}:MyFunc()
return
function MyFunc() as string
return "from static class"
class MyClass
method MyFunc() as string
MyFunc()
return MyFunc()
end class
In X# it throws an stack overflow error, because the "MyFunc()" call in the method calls itself, and not the defined function.
IMHO there should be a compiler option that requires that all method calls are prefixed with self:, otherwise they should not refer to the method of the class, but search outside of the class.
Wolfgang