浏览代码

+ test that should fail compilation and already fails (mantis #28355)

git-svn-id: trunk@38731 -
Jonas Maebe 7 年之前
父节点
当前提交
dfb0869656
共有 2 个文件被更改,包括 33 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 32 0
      tests/webtbf/tw28355.pp

+ 1 - 0
.gitattributes

@@ -14386,6 +14386,7 @@ tests/webtbf/tw2752.pp svneol=native#text/plain
 tests/webtbf/tw2787.pp svneol=native#text/plain
 tests/webtbf/tw2795.pp svneol=native#text/plain
 tests/webtbf/tw28338.pp svneol=native#text/plain
+tests/webtbf/tw28355.pp svneol=native#text/plain
 tests/webtbf/tw2853.pp svneol=native#text/plain
 tests/webtbf/tw2853a.pp svneol=native#text/plain
 tests/webtbf/tw2853b.pp svneol=native#text/plain

+ 32 - 0
tests/webtbf/tw28355.pp

@@ -0,0 +1,32 @@
+{ %fail }
+
+Program FPC30821_Bug;
+{$mode objfpc}
+{$modeswitch advancedrecords}
+
+type
+  TStringWithCounter = record
+     Data : String;
+     Counter : Integer;
+     function Create( Const s : String; i : Integer) : TStringWithCounter;
+  end;
+
+  ttest = class
+    public
+      procedure test();
+  end;
+
+function TStringWithCounter.Create( Const s : String; i : Integer) : TStringWithCounter;
+  begin
+    Result.Data := s;
+    Result.Counter := i;
+  end;
+
+procedure ttest.test();
+  begin
+    TStringWithCounter.Create('aa', 5); // => no error, but I think should be an error
+  end;
+
+
+begin
+end.