mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-26 20:51:27 +01:00
--- Merging r19281 into '.':
U compiler\pdecsub.pas U compiler\symdef.pas U compiler\pdecobj.pas U compiler\htypechk.pas U compiler\ncal.pas U compiler\symtable.pas --- Recording mergeinfo for merge of r19281 into '.': U . --- Merging r19282 into '.': A tests\webtbf\tw19975.pp --- Recording mergeinfo for merge of r19282 into '.': G . git-svn-id: trunk@19343 -
This commit is contained in:
parent
94adf3992d
commit
df75368d0b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11000,6 +11000,7 @@ tests/webtbf/tw1949.pp svneol=native#text/plain
|
|||||||
tests/webtbf/tw19591.pp svneol=native#text/plain
|
tests/webtbf/tw19591.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1969.pp svneol=native#text/plain
|
tests/webtbf/tw1969.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw1995.pp svneol=native#text/plain
|
tests/webtbf/tw1995.pp svneol=native#text/plain
|
||||||
|
tests/webtbf/tw19975.pp svneol=native#text/pascal
|
||||||
tests/webtbf/tw20095.pp svneol=native#text/plain
|
tests/webtbf/tw20095.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw2018.pp svneol=native#text/plain
|
tests/webtbf/tw2018.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw2037.pp svneol=native#text/plain
|
tests/webtbf/tw2037.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -1887,12 +1887,11 @@ implementation
|
|||||||
not hasoverload then
|
not hasoverload then
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
if is_objectpascal_helper(structdef) then
|
if is_objectpascal_helper(structdef) and
|
||||||
|
(tobjectdef(structdef).typ in [recorddef,objectdef]) then
|
||||||
begin
|
begin
|
||||||
if not assigned(tobjectdef(structdef).extendeddef) then
|
|
||||||
Internalerror(2011062601);
|
|
||||||
{ search methods in the extended type as well }
|
{ search methods in the extended type as well }
|
||||||
srsym:=tprocsym(tobjectdef(structdef).extendeddef.symtable.FindWithHash(hashedid));
|
srsym:=tprocsym(tabstractrecorddef(tobjectdef(structdef).extendeddef).symtable.FindWithHash(hashedid));
|
||||||
if assigned(srsym) and
|
if assigned(srsym) and
|
||||||
{ Delphi allows hiding a property by a procedure with the same name }
|
{ Delphi allows hiding a property by a procedure with the same name }
|
||||||
(srsym.typ=procsym) then
|
(srsym.typ=procsym) then
|
||||||
|
|||||||
@ -1638,7 +1638,7 @@ implementation
|
|||||||
function tcallnode.gen_self_tree:tnode;
|
function tcallnode.gen_self_tree:tnode;
|
||||||
var
|
var
|
||||||
selftree : tnode;
|
selftree : tnode;
|
||||||
selfdef : tabstractrecorddef;
|
selfdef : tdef;
|
||||||
begin
|
begin
|
||||||
selftree:=nil;
|
selftree:=nil;
|
||||||
|
|
||||||
@ -1692,7 +1692,8 @@ implementation
|
|||||||
selfdef:=tobjectdef(tprocdef(procdefinition).struct).extendeddef
|
selfdef:=tobjectdef(tprocdef(procdefinition).struct).extendeddef
|
||||||
else
|
else
|
||||||
selfdef:=tprocdef(procdefinition).struct;
|
selfdef:=tprocdef(procdefinition).struct;
|
||||||
if (oo_has_vmt in selfdef.objectoptions) then
|
if (selfdef.typ in [recorddef,objectdef]) and
|
||||||
|
(oo_has_vmt in tabstractrecorddef(selfdef).objectoptions) then
|
||||||
begin
|
begin
|
||||||
{ we only need the vmt, loading self is not required and there is no
|
{ we only need the vmt, loading self is not required and there is no
|
||||||
need to check for typen, because that will always get the
|
need to check for typen, because that will always get the
|
||||||
|
|||||||
@ -634,10 +634,15 @@ implementation
|
|||||||
Message1(type_e_record_helper_must_extend_same_record,current_objectdef.childof.extendeddef.typename);
|
Message1(type_e_record_helper_must_extend_same_record,current_objectdef.childof.extendeddef.typename);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
else
|
||||||
|
hdef:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
current_objectdef.extendeddef:=tabstractrecorddef(hdef);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if assigned(hdef) then
|
||||||
|
current_objectdef.extendeddef:=hdef
|
||||||
|
else
|
||||||
|
current_objectdef.extendeddef:=generrordef;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure parse_guid;
|
procedure parse_guid;
|
||||||
@ -1233,7 +1238,8 @@ implementation
|
|||||||
{ if this helper is defined in the implementation section of the unit
|
{ if this helper is defined in the implementation section of the unit
|
||||||
or inside the main project file, the extendeddefs list of the current
|
or inside the main project file, the extendeddefs list of the current
|
||||||
module must be updated (it will be removed when poping the symtable) }
|
module must be updated (it will be removed when poping the symtable) }
|
||||||
if is_objectpascal_helper(current_structdef) then
|
if is_objectpascal_helper(current_structdef) and
|
||||||
|
(current_objectdef.extendeddef.typ in [recorddef,objectdef]) then
|
||||||
begin
|
begin
|
||||||
{ the topmost symtable must be a static symtable }
|
{ the topmost symtable must be a static symtable }
|
||||||
st:=current_structdef.owner;
|
st:=current_structdef.owner;
|
||||||
@ -1241,7 +1247,7 @@ implementation
|
|||||||
st:=st.defowner.owner;
|
st:=st.defowner.owner;
|
||||||
if st.symtabletype=staticsymtable then
|
if st.symtabletype=staticsymtable then
|
||||||
begin
|
begin
|
||||||
s:=make_mangledname('',current_objectdef.extendeddef.symtable,'');
|
s:=make_mangledname('',tabstractrecorddef(current_objectdef.extendeddef).symtable,'');
|
||||||
list:=TFPObjectList(current_module.extendeddefs.Find(s));
|
list:=TFPObjectList(current_module.extendeddefs.Find(s));
|
||||||
if not assigned(list) then
|
if not assigned(list) then
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -245,7 +245,7 @@ implementation
|
|||||||
storepos : tfileposinfo;
|
storepos : tfileposinfo;
|
||||||
vs : tparavarsym;
|
vs : tparavarsym;
|
||||||
hdef : tdef;
|
hdef : tdef;
|
||||||
selfdef : tabstractrecorddef;
|
selfdef : tdef;
|
||||||
vsp : tvarspez;
|
vsp : tvarspez;
|
||||||
aliasvs : tabsolutevarsym;
|
aliasvs : tabsolutevarsym;
|
||||||
sl : tpropaccesslist;
|
sl : tpropaccesslist;
|
||||||
|
|||||||
@ -264,7 +264,7 @@ interface
|
|||||||
childofderef : tderef;
|
childofderef : tderef;
|
||||||
|
|
||||||
{ for Object Pascal helpers }
|
{ for Object Pascal helpers }
|
||||||
extendeddef : tabstractrecorddef;
|
extendeddef : tdef;
|
||||||
extendeddefderef: tderef;
|
extendeddefderef: tderef;
|
||||||
{ for C++ classes: name of the library this class is imported from }
|
{ for C++ classes: name of the library this class is imported from }
|
||||||
import_lib,
|
import_lib,
|
||||||
@ -1037,9 +1037,10 @@ implementation
|
|||||||
if not (st.symlist[i] is ttypesym) then
|
if not (st.symlist[i] is ttypesym) then
|
||||||
continue;
|
continue;
|
||||||
def:=ttypesym(st.SymList[i]).typedef;
|
def:=ttypesym(st.SymList[i]).typedef;
|
||||||
if is_objectpascal_helper(def) then
|
if is_objectpascal_helper(def) and
|
||||||
|
(tobjectdef(def).extendeddef.typ in [recorddef,objectdef]) then
|
||||||
begin
|
begin
|
||||||
s:=make_mangledname('',tobjectdef(def).extendeddef.symtable,'');
|
s:=make_mangledname('',tabstractrecorddef(tobjectdef(def).extendeddef).symtable,'');
|
||||||
list:=TFPObjectList(current_module.extendeddefs.Find(s));
|
list:=TFPObjectList(current_module.extendeddefs.Find(s));
|
||||||
if not assigned(list) then
|
if not assigned(list) then
|
||||||
begin
|
begin
|
||||||
@ -4691,7 +4692,7 @@ implementation
|
|||||||
else
|
else
|
||||||
tstoredsymtable(symtable).deref;
|
tstoredsymtable(symtable).deref;
|
||||||
if objecttype=odt_helper then
|
if objecttype=odt_helper then
|
||||||
extendeddef:=tobjectdef(extendeddefderef.resolve);
|
extendeddef:=tdef(extendeddefderef.resolve);
|
||||||
for i:=0 to vmtentries.count-1 do
|
for i:=0 to vmtentries.count-1 do
|
||||||
begin
|
begin
|
||||||
vmtentry:=pvmtentry(vmtentries[i]);
|
vmtentry:=pvmtentry(vmtentries[i]);
|
||||||
|
|||||||
@ -2428,14 +2428,17 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ now search in the extended type itself }
|
{ now search in the extended type itself }
|
||||||
srsymtable:=classh.extendeddef.symtable;
|
if classh.extendeddef.typ in [recorddef,objectdef] then
|
||||||
srsym:=tsym(srsymtable.FindWithHash(hashedid));
|
|
||||||
if assigned(srsym) and
|
|
||||||
is_visible_for_object(srsym,contextclassh) then
|
|
||||||
begin
|
begin
|
||||||
addsymref(srsym);
|
srsymtable:=tabstractrecorddef(classh.extendeddef).symtable;
|
||||||
result:=true;
|
srsym:=tsym(srsymtable.FindWithHash(hashedid));
|
||||||
exit;
|
if assigned(srsym) and
|
||||||
|
is_visible_for_object(srsym,contextclassh) then
|
||||||
|
begin
|
||||||
|
addsymref(srsym);
|
||||||
|
result:=true;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
{ now search in the parent helpers }
|
{ now search in the parent helpers }
|
||||||
parentclassh:=classh.childof;
|
parentclassh:=classh.childof;
|
||||||
|
|||||||
15
tests/webtbf/tw19975.pp
Normal file
15
tests/webtbf/tw19975.pp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
program uGenHelper;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
type
|
||||||
|
generic TGeneric<T> = class
|
||||||
|
end;
|
||||||
|
|
||||||
|
THelper = class helper for TGeneric
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user