mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 22:10:51 +02:00
Fix for Mantis #26615.
htypechk.pas, tcallcandidates: * collect_overloads_in_struct: we need to check the deftyp of the extended def for record- or objectdef, not the deftyp of the helper which will always be objectdef anyway. + added test git-svn-id: trunk@28572 -
This commit is contained in:
parent
74e56c2674
commit
244ac12794
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14067,6 +14067,7 @@ tests/webtbs/tw2649.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2651.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2656.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2659.pp svneol=native#text/plain
|
||||
tests/webtbs/tw26615.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw26627.pp -text svneol=native#text/plain
|
||||
tests/webtbs/tw2666.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2668.pp svneol=native#text/plain
|
||||
|
@ -2227,7 +2227,7 @@ implementation
|
||||
break;
|
||||
end;
|
||||
if is_objectpascal_helper(structdef) and
|
||||
(tobjectdef(structdef).typ in [recorddef,objectdef]) then
|
||||
(tobjectdef(structdef).extendeddef.typ in [recorddef,objectdef]) then
|
||||
begin
|
||||
{ search methods in the extended type as well }
|
||||
srsym:=tprocsym(tabstractrecorddef(tobjectdef(structdef).extendeddef).symtable.FindWithHash(hashedid));
|
||||
|
29
tests/webtbs/tw26615.pp
Normal file
29
tests/webtbs/tw26615.pp
Normal file
@ -0,0 +1,29 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw26615;
|
||||
|
||||
{$MODE OBJFPC}{$H+}
|
||||
{$MODESWITCH TYPEHELPERS}
|
||||
|
||||
uses
|
||||
sysutils;
|
||||
|
||||
type
|
||||
TStringHelper = type helper for UnicodeString
|
||||
class function Cr(AStr: UnicodeString): UnicodeString; static; overload;
|
||||
end;
|
||||
|
||||
class function TStringHelper.Cr(AStr: UnicodeString): UnicodeString;
|
||||
begin
|
||||
Result := '#'+AStr;
|
||||
end;
|
||||
|
||||
var
|
||||
us: UnicodeString;
|
||||
|
||||
begin
|
||||
|
||||
us := UnicodeString.Cr('a');
|
||||
writeln(us);
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user