If I have a Enum with size, in this case of Int64, the ToString Method of the Enum don’t work.
Works in NET
namespace testEnum;
type
TSyntaxNodeType = public enum (
ntAddr, //unary
ntAnonymousMethod
) of Int64;
type
TSyntaxNodeTypeHelper = public extension class(TSyntaxNodeType)
public
method EnumName() : String;
begin
exit Self.ToString.Substring(2);
end;
end;
Program = class
public
class method Main(args: array of String): Int32;
begin
// add your own code here
writeLn('The magic happens here.');
var lTest : TSyntaxNodeType := TSyntaxNodeType.ntAnonymousMethod;
var lName := lTest.EnumName;
writeLn(lName);
if lName.CompareTo('AnonymousMethod') = 0 then
writeLn('is Equal')
else
writeLn('is not Equal');
end;
end;
end.
The result:
The magic happens here.
94967296
is not Equal