mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 12:48:16 +02:00

sized integer (succeed for Delphi, fail for objfpc) * fixed compiler so it only allows typecasting a class/interface to a differently sized integer in Delphi mode git-svn-id: trunk@13152 -
18 lines
259 B
ObjectPascal
18 lines
259 B
ObjectPascal
{ %fail }
|
|
|
|
// check whether enums can NOT be casted to object references; this
|
|
// should NOT work in objfpc mode (see also tbs/tb0554.pp)
|
|
{$mode objfpc}
|
|
|
|
{$packenum 2}
|
|
type
|
|
TEnum = (a, b, c);
|
|
|
|
var
|
|
e : TEnum;
|
|
o : TObject;
|
|
|
|
begin
|
|
e := TEnum(o);
|
|
end.
|