fpc/tests/webtbs/tw2442.pp
Jonas Maebe c6733ed9a5 * disallow placing fields after method/property definitions, because this
can create ambiguities for the parser in case the field names also exist
    as modifiers (TP- and Delphi-compatible, mantis #13971) + tests
  * fixed tests that broke because of this change

git-svn-id: trunk@13334 -
2009-06-27 12:59:46 +00:00

47 lines
946 B
ObjectPascal

{ Source provided for Free Pascal Bug Report 2442 }
{ Submitted by "Louis Jean-Richard" on 2003-03-28 }
{ e-mail: Ljean_richard@compuserve.com }
PROGRAM Procall;
TYPE
anObject =
OBJECT
n : byte;
PROCEDURE A( w : word );
PROCEDURE A( c : cardinal );
END
;
PROCEDURE anObject.A( w : word );
PROCEDURE B;
BEGIN
WriteLn('B called (word)')
END
;
BEGIN
n:=w DIV 2;
B
END
;
PROCEDURE anObject.A( c : cardinal );
PROCEDURE B;
BEGIN
WriteLn('B called (cardinal)');
writeln('error!');
halt(1);
END
;
BEGIN
n:=c DIV 4;
B
END
;
VAR
x : anObject;
w : word;
BEGIN
w:=1;
x.A(w) { the wrong local procedure is called !!! }
END
.