mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 07:18:23 +02:00
# revisions: 42328,42329
git-svn-id: branches/fixes_3_2@43401 -
This commit is contained in:
parent
89e051bac9
commit
c4b9529d6b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16443,6 +16443,7 @@ tests/webtbs/tw3564.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3567.pp svneol=native#text/plain
|
tests/webtbs/tw3567.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3572.pp svneol=native#text/plain
|
tests/webtbs/tw3572.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3573.pp svneol=native#text/plain
|
tests/webtbs/tw3573.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw35735.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3576.pp svneol=native#text/plain
|
tests/webtbs/tw3576.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3577.pp svneol=native#text/plain
|
tests/webtbs/tw3577.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3578.pp svneol=native#text/plain
|
tests/webtbs/tw3578.pp svneol=native#text/plain
|
||||||
|
@ -1259,7 +1259,10 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if (idtoken=_GENERIC) and
|
if (idtoken=_GENERIC) and
|
||||||
not (m_delphi in current_settings.modeswitches) and
|
not (m_delphi in current_settings.modeswitches) and
|
||||||
not fields_allowed then
|
(
|
||||||
|
not fields_allowed or
|
||||||
|
is_objectpascal_helper(current_structdef)
|
||||||
|
) then
|
||||||
begin
|
begin
|
||||||
if hadgeneric then
|
if hadgeneric then
|
||||||
Message(parser_e_procedure_or_function_expected);
|
Message(parser_e_procedure_or_function_expected);
|
||||||
|
@ -1050,6 +1050,16 @@ implementation
|
|||||||
HideSym(srsym);
|
HideSym(srsym);
|
||||||
searchagain:=true;
|
searchagain:=true;
|
||||||
end
|
end
|
||||||
|
else if (srsym.typ=typesym) and
|
||||||
|
(sp_generic_dummy in srsym.symoptions) and
|
||||||
|
(ttypesym(srsym).typedef.typ=undefineddef) then
|
||||||
|
begin
|
||||||
|
{ this is a generic dummy symbol that has not yet
|
||||||
|
been used; so we rename the dummy symbol and continue
|
||||||
|
as if nothing happened }
|
||||||
|
hidesym(srsym);
|
||||||
|
searchagain:=true;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ we use a different error message for tp7 so it looks more compatible }
|
{ we use a different error message for tp7 so it looks more compatible }
|
||||||
|
33
tests/webtbs/tw35735.pp
Normal file
33
tests/webtbs/tw35735.pp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
|
||||||
|
program tw35735;
|
||||||
|
|
||||||
|
{$Mode objfpc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TObjectHelper }
|
||||||
|
|
||||||
|
TObjectHelper = class helper for TObject
|
||||||
|
public
|
||||||
|
generic function Test<T>(): String;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TComponentHelper }
|
||||||
|
|
||||||
|
generic function TObjectHelper.Test<T>: String;
|
||||||
|
begin
|
||||||
|
Result := T.ClassName
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
O: TObject;
|
||||||
|
begin
|
||||||
|
O := TObject.Create;
|
||||||
|
WriteLn(O.specialize Test<TPersistent>);
|
||||||
|
O.Free;
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user