Fix for Mantis #29792.

htypechk.pas, tcallcandidates:
  * create_candidate_list: check the correct tableoptions for sto_has_overload flag

+ added test

git-svn-id: trunk@33211 -
This commit is contained in:
svenbarth 2016-03-09 20:45:26 +00:00
parent 463c9f6e42
commit e58488dc3e
3 changed files with 35 additions and 1 deletions

1
.gitattributes vendored
View File

@ -14977,6 +14977,7 @@ tests/webtbs/tw29669.pp svneol=native#text/plain
tests/webtbs/tw29669a.pp svneol=native#text/plain
tests/webtbs/tw2975.pp svneol=native#text/plain
tests/webtbs/tw2976.pp svneol=native#text/plain
tests/webtbs/tw29792.pp svneol=native#text/pascal
tests/webtbs/tw2983.pp svneol=native#text/plain
tests/webtbs/tw2984.pp svneol=native#text/plain
tests/webtbs/tw2998.pp svneol=native#text/plain

View File

@ -2396,7 +2396,7 @@ implementation
while assigned(pt) do
begin
if (pt.resultdef.typ=recorddef) and
(sto_has_operator in tabstractrecorddef(pt.resultdef).owner.tableoptions) then
(sto_has_operator in tabstractrecorddef(pt.resultdef).symtable.tableoptions) then
collect_overloads_in_struct(tabstractrecorddef(pt.resultdef),ProcdefOverloadList,searchhelpers,anoninherited,spezcontext);
pt:=tcallparanode(pt.right);
end;

33
tests/webtbs/tw29792.pp Normal file
View File

@ -0,0 +1,33 @@
unit tw29792;
{$mode delphi}
interface
type
{ TMyRecord }
TMyRecord<T> = record
class operator Add(A,B: TMyRecord<T>): TMyRecord<T>;
end;
implementation
{ TMyRecord }
class operator TMyRecord<T>.Add(A, B: TMyRecord<T>): TMyRecord<T>;
begin
// add implementation
end;
procedure TestIfCompiles;
type
TInteger = TMyRecord<Integer>;
var
N1, N2, N3: TInteger;
begin
N1 := N2 + N3;
end;
end.