summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw2442.pp
blob: b1624159799701cf2a429304cb50792453bf9751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ 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
                        PROCEDURE A( w : word );
                        PROCEDURE A( c : cardinal );
                        n       : byte;
                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
.