git-svn-id: trunk@3028 -
This commit is contained in:
Jonas Maebe 2006-03-24 22:57:50 +00:00
parent e8c2c4abb2
commit 9c14f95ce9
2 changed files with 41 additions and 0 deletions

1
.gitattributes vendored
View File

@ -6750,6 +6750,7 @@ tests/webtbs/tw4635.pp svneol=native#text/plain
tests/webtbs/tw4640.pp svneol=native#text/plain
tests/webtbs/tw4669.pp svneol=native#text/plain
tests/webtbs/tw4675.pp svneol=native#text/plain
tests/webtbs/tw4678.pp -text
tests/webtbs/tw4700.pp svneol=native#text/plain
tests/webtbs/tw4704.pp -text
tests/webtbs/tw4763.pp svneol=native#text/plain

40
tests/webtbs/tw4678.pp Normal file
View File

@ -0,0 +1,40 @@
{ %OPT=-Sd }
{ Source provided for Free Pascal Bug Report 4678 }
{ Submitted by "Phil H." on 2006-01-09 }
{ e-mail: pjhess@purdue.edu }
program TestVarBug2;
uses
Variants;
type
TMyClass = class
private
function GetValue(AnInt : Integer) : Variant;
public
property Value[AnInt : Integer] : Variant read GetValue;
end;
function TMyClass.GetValue(AnInt : Integer) : Variant;
begin
if AnInt < 0 then
Result := Null
else
Result := AnInt;
end;
var
AClass : TMyClass;
VarVal : Variant;
begin
AClass := TMyClass.Create;
// This statement throws an exception with FPC.
// Should assign Null to VarVal as per Delphi rule:
// "any operation on a Null variant produces a Null variant".
VarVal := AClass.Value[5] + AClass.Value[-1] + 1;
end.