Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. TMyType1 = class
  2. public type
  3. TMyType1Enum = (unknown, val1, val2);
  4. public
  5. constructor Create();
  6. ...
  7. end;
  8.  
  9. TMyType2 = class
  10. public type
  11. TMyType2Enum = (unknown, other1, other2, other3); // causes E2004
  12. public
  13. constructor Create();
  14. ...
  15. end;
  16.  
  17. type
  18. TFoo = (A, B, Foo);
  19. {$SCOPEDENUMS ON}
  20. TBar = (A, B, Bar);
  21. {$SCOPEDENUMS OFF}
  22.  
  23. begin
  24. WriteLn(Integer(Foo));
  25. WriteLn(Integer(A)); // TFoo.A
  26. WriteLn(Integer(TBar.B));
  27. WriteLn(Integer(TBar.Bar));
  28. WriteLn(Integer(Bar)); // Error
  29. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement