mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 02:51:36 +02:00
compiler: allow use of default properties for records (issue #0019098)
git-svn-id: trunk@17334 -
This commit is contained in:
parent
62e11742bf
commit
56cd7b3450
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9694,6 +9694,7 @@ tests/test/tenum5.pp svneol=native#text/plain
|
|||||||
tests/test/tenum6.pp svneol=native#text/pascal
|
tests/test/tenum6.pp svneol=native#text/pascal
|
||||||
tests/test/tenumerators1.pp svneol=native#text/pascal
|
tests/test/tenumerators1.pp svneol=native#text/pascal
|
||||||
tests/test/terecs1.pp svneol=native#text/pascal
|
tests/test/terecs1.pp svneol=native#text/pascal
|
||||||
|
tests/test/terecs10.pp svneol=native#text/pascal
|
||||||
tests/test/terecs2.pp svneol=native#text/pascal
|
tests/test/terecs2.pp svneol=native#text/pascal
|
||||||
tests/test/terecs3.pp svneol=native#text/pascal
|
tests/test/terecs3.pp svneol=native#text/pascal
|
||||||
tests/test/terecs4.pp svneol=native#text/pascal
|
tests/test/terecs4.pp svneol=native#text/pascal
|
||||||
|
|||||||
@ -1927,7 +1927,7 @@ implementation
|
|||||||
_LECKKLAMMER:
|
_LECKKLAMMER:
|
||||||
begin
|
begin
|
||||||
if is_class_or_interface_or_object(p1.resultdef) or
|
if is_class_or_interface_or_object(p1.resultdef) or
|
||||||
is_dispinterface(p1.resultdef) then
|
is_dispinterface(p1.resultdef) or is_record(p1.resultdef) then
|
||||||
begin
|
begin
|
||||||
{ default property }
|
{ default property }
|
||||||
protsym:=search_default_property(tobjectdef(p1.resultdef));
|
protsym:=search_default_property(tobjectdef(p1.resultdef));
|
||||||
|
|||||||
23
tests/test/terecs10.pp
Normal file
23
tests/test/terecs10.pp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
program terecs10;
|
||||||
|
|
||||||
|
{$ifdef fpc}
|
||||||
|
{$mode delphi}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = record
|
||||||
|
function GetTest(Index: Integer): Integer;
|
||||||
|
property Test[Index: Integer]: Integer read GetTest; default;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TTest.GetTest(Index: Integer): Integer;
|
||||||
|
begin
|
||||||
|
Result := Index;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
t: TTest;
|
||||||
|
begin
|
||||||
|
if t[42] <> 42 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user