Is there a way to put nested enumerations in Delphi into an own naming space?
This code produces an E2004: Identifier redeclared, as both enumerations contain "unknown".
TMyType1 = class
public type
TMyType1Enum = (unknown, val1, val2);
public
constructor Create();
...
end;
TMyType2 = class
public type
TMyType2Enum = (unknown, other1, other2, other3); // causes E2004
public
constructor Create();
...
end;
In C++ the identifiers of the enum elements were both in differnet scopes (TMyType1::unknown and TMyType2::unknown).
Is there a possibility to achieve something like this in Delphi except pre- or suffixing the identifiers (MyType1EnumUnknown, MyType1EnumVal1, ..., MyType2Enumunknown,...)?