Sign in Join

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

Mailing lists / fpc-devel / 2014-06

Can no longer convert Set of Enum to Integer (on latest SVN ... as of 5-10 minutes ago)

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Den

Hello all,

As the subject implies, code that has previously ran:

-----------

Type TSomeEnumSet = Set OF (seOne, seTwo, seThree, seFour);
Var SomeSet : TSomeEnumSet;
Begin
   Writeln(Integer(SomeSet) );
End.

-----------

Results in: Error: Illegal type conversion: "TSomeEnumSet" to "LongInt"

-----------

This should be possible (in the documentation for a set " The compiler stores small sets (less than 32 elements) in a Longint"), what has changed? (using latest SVN as of 5-10 minutes ago :p)

- Dennis

Reply by email

Marco van de Voort
to Den

In our previous episode, Den said:

Show quoted text 19 lines
----------- Type TSomeEnumSet = Set OF (seOne, seTwo, seThree, seFour); Var SomeSet : TSomeEnumSet; Begin Writeln(Integer(SomeSet) ); End. ----------- Results in: Error: Illegal type conversion: "TSomeEnumSet" to "LongInt" ----------- This should be possible (in the documentation for a set " The compiler stores small sets (less than 32 elements) in a Longint"), what has changed? (using latest SVN as of 5-10 minutes ago :p)

Maybe change mode? (delphi instead of objfpc?)

Print sizeof someset.

Reply by email