peter 22 vuotta sitten
vanhempi
commit
d34df34994
1 muutettua tiedostoa jossa 40 lisäystä ja 0 poistoa
  1. 40 0
      tests/webtbf/tw2751.pp

+ 40 - 0
tests/webtbf/tw2751.pp

@@ -0,0 +1,40 @@
+{ %fail }
+
+{ Source provided for Free Pascal Bug Report 2751 }
+{ Submitted by "Micha" on  2003-10-26 }
+{ e-mail:  }
+program Construct;
+
+{$mode delphi}
+
+type
+
+  ta = class
+  public
+    constructor Create(a: tclass);
+  end;
+
+  tb = class(ta)
+  public
+    constructor Create(a: tobject);
+  end;
+
+constructor ta.create(a: tclass);
+begin
+end;
+
+constructor tb.create(a: tobject);
+begin
+end;
+
+var
+  b: tb;
+  c: tclass;
+
+begin
+  c := tb;
+  // This should fail
+  b := tb.create(c);
+  b.free;
+end.
+