Compatibility with VO: function or method
Posted: Wed Aug 01, 2018 3:58 pm
Hello,
porting one of my libraries I have come around a IMHO serious issue.
Please see the following code:
If you execute this code in VO, it works as expected.
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
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