Browse Source

* check dup id for tp/delphi

peter 25 years ago
parent
commit
97d5c0b6ac
2 changed files with 57 additions and 0 deletions
  1. 27 0
      tests/tbf/tbf0320.pp
  2. 30 0
      tests/tbs/tbs0319.pp

+ 27 - 0
tests/tbf/tbf0320.pp

@@ -0,0 +1,27 @@
+{$ifdef fpc}{$mode delphi}{$endif}
+
+{ These should give an error, as also done in tp,delphi.
+  See tbs0319.pp for a test with class which should compile in
+  delphi mode }
+
+type
+  cl=object
+    k : longint;
+    procedure p1;
+    procedure p2;
+  end;
+
+procedure cl.p1;
+var
+  k : longint;
+begin
+end;
+
+procedure cl.p2;
+var
+  p1 : longint;
+begin
+end;
+
+begin
+end.

+ 30 - 0
tests/tbs/tbs0319.pp

@@ -0,0 +1,30 @@
+{$ifdef fpc}{$mode delphi}{$endif}
+
+function a:longint;
+var
+  a : longint;
+begin
+  a:=1;
+end;
+
+type
+  cl=class
+    k : longint;
+    procedure p1;
+    procedure p2;
+  end;
+
+procedure cl.p1;
+var
+  k : longint;
+begin
+end;
+
+procedure cl.p2;
+var
+  p1 : longint;
+begin
+end;
+
+begin
+end.