fpc/tests/tbf/tb0214a.pp
Jonas Maebe b7235b21c9 * no longer allow assigning values to typecasted properties, because in
case the getter is a function, the result is that first the getter is
    called, and subsequently the temp holding the function result is
    overwritten (thus not changing anything). This is Delphi-compatible,
    and fixes tests/tbf/tb0214*

git-svn-id: trunk@13320 -
2009-06-23 18:42:53 +00:00

24 lines
363 B
ObjectPascal

{ %fail }
{$ifdef fpc}
{$mode delphi}
{$endif}
type
tc = class
private
fl: longint;
public
property l: longint read fl write fl;
end;
var
c: tc;
begin
{ should give an error stating that you cannot assign to left hand side }
{ (generated code also does not result in an assignment) }
cardinal(c.l):=cardinal(5);
end.