Sign in Join

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

Mailing lists / fpc-devel / 2020-03

AS-IS for enums

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Ondrej Pokorny

Hello Florian,

as we spoke I checked the patch for IS&AS operators for enumerations. I also added int64/dword value compatibility that was missing in the last patches.

There is still some bug/issue left. The objfpc mode shows warnings like this:
test_as_is_1.lpr(51,8) Warning: Expectloc is not set in firstpass: calln

and the delphi mode crashes with an internal error 200306031.

I don't remember that this bug happened the last time I was working on this. Could you please take a look at it?

I also added the check for enums with holes in objfpc mode that disables the IS&AS operators there. It is marked with a ToDo comment. If you decide to keep it there we need a new error message. If you decide to delete it we don't need a new error message. I would personally delete the extra check and enable AS&IS also for enums with holes (checking only boundaries) but I don't care that much.

I attach the latest patch and a test program.

Thanks
Ondrej

Reply by email