mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 15:59:45 +02:00
*** empty log message ***
This commit is contained in:
parent
302c977a8b
commit
e792ab5ab1
25
tests/tbf/tb0125.pp
Normal file
25
tests/tbf/tb0125.pp
Normal file
@ -0,0 +1,25 @@
|
||||
{ %fail }
|
||||
{ Returns this error under Delphi :
|
||||
{ Error: Types of actual and formal var parameters must be identical }
|
||||
{$ifdef fpc}
|
||||
{$mode objfpc}
|
||||
{$endif}
|
||||
type
|
||||
tsymbol = class
|
||||
end;
|
||||
|
||||
tderivedsymbol = class(tsymbol)
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure testclass(var t: tsymbol);
|
||||
begin
|
||||
end;
|
||||
|
||||
var
|
||||
myclass : tderivedsymbol;
|
||||
begin
|
||||
myclass := tderivedsymbol.create;
|
||||
testclass(myclass);
|
||||
end.
|
25
tests/tbf/tb0126.pp
Normal file
25
tests/tbf/tb0126.pp
Normal file
@ -0,0 +1,25 @@
|
||||
{ %fail }
|
||||
{ This program should fail compilation, since
|
||||
the declaration is not the same as the actual
|
||||
implementation, checked against Delphi 3 -
|
||||
the class keyword is missing in front
|
||||
of procedure tmyclass.myproc
|
||||
}
|
||||
{$ifdef fpc}
|
||||
{$mode objfpc}
|
||||
{$endif}
|
||||
type
|
||||
tmyclass = class
|
||||
class procedure myproc;virtual;
|
||||
end;
|
||||
|
||||
{ missing class keyword in front of procedure }
|
||||
procedure tmyclass.myproc;
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
Begin
|
||||
end.
|
||||
|
||||
|
22
tests/tbs/tb0408.pp
Normal file
22
tests/tbs/tb0408.pp
Normal file
@ -0,0 +1,22 @@
|
||||
{ This passes under Delphi and Borland pascal }
|
||||
{ for objects, classes don't pass, cf. /tbf/tb0125 }
|
||||
type
|
||||
|
||||
tobjsymbol = object
|
||||
end;
|
||||
|
||||
tobjderivedsymbol = object(tobjsymbol)
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure testobject(var t: tobjsymbol);
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
myobject : tobjderivedsymbol;
|
||||
begin
|
||||
testobject(myobject);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user