From dfb08696562aafb233d93a2b12be56a5004a81d6 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Tue, 10 Apr 2018 19:34:22 +0000 Subject: [PATCH] + test that should fail compilation and already fails (mantis #28355) git-svn-id: trunk@38731 - --- .gitattributes | 1 + tests/webtbf/tw28355.pp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/webtbf/tw28355.pp diff --git a/.gitattributes b/.gitattributes index aebba1a023..3db683c650 100644 --- a/.gitattributes +++ b/.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 diff --git a/tests/webtbf/tw28355.pp b/tests/webtbf/tw28355.pp new file mode 100644 index 0000000000..190681cac7 --- /dev/null +++ b/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.