* disallow new(property) (mantis #13992)

git-svn-id: trunk@13288 -
This commit is contained in:
Jonas Maebe 2009-06-18 09:23:43 +00:00
parent b05992b8a2
commit 47702aa3a5
3 changed files with 80 additions and 0 deletions

2
.gitattributes vendored
View File

@ -8601,6 +8601,7 @@ tests/webtbf/tw13563a.pp svneol=native#text/plain
tests/webtbf/tw1365.pp svneol=native#text/plain
tests/webtbf/tw13815.pp svneol=native#text/plain
tests/webtbf/tw1395.pp svneol=native#text/plain
tests/webtbf/tw13992.pp svneol=native#text/plain
tests/webtbf/tw1407.pp svneol=native#text/plain
tests/webtbf/tw1432.pp svneol=native#text/plain
tests/webtbf/tw1467.pp svneol=native#text/plain
@ -9161,6 +9162,7 @@ tests/webtbs/tw13872.pp svneol=native#text/plain
tests/webtbs/tw13890.pp svneol=native#text/plain
tests/webtbs/tw13948.pp svneol=native#text/plain
tests/webtbs/tw1398.pp svneol=native#text/plain
tests/webtbs/tw13992a.pp svneol=native#text/plain
tests/webtbs/tw1401.pp svneol=native#text/plain
tests/webtbs/tw1407.pp svneol=native#text/plain
tests/webtbs/tw1408.pp svneol=native#text/plain

39
tests/webtbf/tw13992.pp Normal file
View File

@ -0,0 +1,39 @@
{ %fail }
{ new(property) should fail }
program test_prop;
{$mode delphi}
type
TMyRec = record
s: string;
end;
PMyRec = ^TMyRec;
TSomeClass = class
private
FMyRec: PMyRec;
public
constructor Create;
destructor Destroy; override;
property MyRec: PMyRec read FMyRec write FMyRec;
end;
{ TSomeClass }
constructor TSomeClass.Create;
begin
New(MyRec);
end;
destructor TSomeClass.Destroy;
begin
// Dispose(MyRec);
inherited;
end;
begin
end.

39
tests/webtbs/tw13992a.pp Normal file
View File

@ -0,0 +1,39 @@
{ %norun }
{ dispose(property) should be accepted }
program test_prop;
{$mode delphi}
type
TMyRec = record
s: string;
end;
PMyRec = ^TMyRec;
TSomeClass = class
private
FMyRec: PMyRec;
public
constructor Create;
destructor Destroy; override;
property MyRec: PMyRec read FMyRec write FMyRec;
end;
{ TSomeClass }
constructor TSomeClass.Create;
begin
// New(MyRec);
end;
destructor TSomeClass.Destroy;
begin
Dispose(MyRec);
inherited;
end;
begin
end.