Sign in Join

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

Mailing lists / fpc-pascal / 2010-04

Accessing static field using properties.

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Torsten Bonde Christiansen

Hi List

After spending a good deal of time trying to figure out why my program crashed at runtime, I narrowed it down to accessing a static field in a class through a property.

Although there were no compile time warning/error the program crashed the very instant i tried to access the static field through a property.

There is no documentation stating that this is im-/possible, so I'm not sure whether this is a bug or just me writing horrible code... ;)

Kind regards,
Torsten Bonde Christiansen.

Jonas Maebe
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote 7 lines
After spending a good deal of time trying to figure out why my program crashed at runtime, I narrowed it down to accessing a static field in a class through a property. Although there were no compile time warning/error the program crashed the very instant i tried to access the static field through a property.

This has been fixed in FPC 2.5.1: http://bugs.freepascal.org/view.php?id=16080

Note that you have to use "class property" rather than just "property" to access static fields (but again, that doesn't work either in FPC 2.4.0).

Jonas