Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-10

FPC 2.4.4 - Error: Illegal type conversion: "Set of TMySet" to "Byte" ... and vice versa

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

fred f

Hi guys,

I am trying to compile my code which is compatible with Delphi and FPC 2.5.1+, but when I try to compile on Mac OS X with 2.4.4 I have error message:

Error: Illegal type conversion: "Set of TMyEnum" to "Byte"

and

Error: Illegal type conversion: "Byte" to "Set of TMyEnum"

The code is following:

type TMyEnum = (meFirst, meSecond);
type TMyEnumSet = set of TMyEnum;
var myEnum:TMyEnumSet;
    b:byte;
...
  b := byte (myEnum);

or

 myEnum := TMyEnumSet(b);

What is wrong on this for 2.4.4?

Thanks.

ff.

Reply by email