mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 10:58:23 +02:00
* fix for Mantis #31431: allow specializations to allow private/protected variables that their generic could have accessed
git-svn-id: trunk@35510 -
This commit is contained in:
parent
5426c11611
commit
7dc4f16db3
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -15387,6 +15387,7 @@ tests/webtbs/tw31332.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3137.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31421a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3143.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31431.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3144.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3157.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3160a.pp svneol=native#text/plain
|
||||
@ -16055,6 +16056,7 @@ tests/webtbs/uw2920.pp svneol=native#text/plain
|
||||
tests/webtbs/uw2956.pp svneol=native#text/plain
|
||||
tests/webtbs/uw2984.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3103.pp svneol=native#text/plain
|
||||
tests/webtbs/uw31431.pp svneol=native#text/pascal
|
||||
tests/webtbs/uw3179a.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3179b.pp svneol=native#text/plain
|
||||
tests/webtbs/uw3184a.pp svneol=native#text/plain
|
||||
|
@ -2949,6 +2949,13 @@ implementation
|
||||
(
|
||||
isspezproc and
|
||||
(current_procinfo.procdef.struct=current_structdef)
|
||||
) or
|
||||
{ specializations may access private symbols that their
|
||||
generics are allowed to access }
|
||||
(
|
||||
assigned(current_structdef) and
|
||||
(df_specialization in current_structdef.defoptions) and
|
||||
(symst.moduleid=current_structdef.genericdef.owner.moduleid)
|
||||
)
|
||||
);
|
||||
end;
|
||||
@ -3023,6 +3030,13 @@ implementation
|
||||
(
|
||||
isspezproc and
|
||||
(current_procinfo.procdef.struct=current_structdef)
|
||||
) or
|
||||
{ specializations may access private symbols that their
|
||||
generics are allowed to access }
|
||||
(
|
||||
assigned(current_structdef) and
|
||||
(df_specialization in current_structdef.defoptions) and
|
||||
(symst.moduleid=current_structdef.genericdef.owner.moduleid)
|
||||
)
|
||||
);
|
||||
end;
|
||||
|
14
tests/webtbs/tw31431.pp
Normal file
14
tests/webtbs/tw31431.pp
Normal file
@ -0,0 +1,14 @@
|
||||
program tw31431;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
uses
|
||||
uw31431;
|
||||
|
||||
type
|
||||
TSpecialisedClass = specialize TBar<Integer>;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
||||
|
26
tests/webtbs/uw31431.pp
Normal file
26
tests/webtbs/uw31431.pp
Normal file
@ -0,0 +1,26 @@
|
||||
unit uw31431;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TFoo = class
|
||||
private
|
||||
type
|
||||
TID = Integer;
|
||||
protected
|
||||
type
|
||||
TID2 = Integer;
|
||||
end;
|
||||
|
||||
generic TBar<T> = class
|
||||
private
|
||||
FID: TFoo.TID;
|
||||
FID2: TFoo.TID2;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user