mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 01:26:31 +02:00
Codetools: parse specialization as function result (in function type def) Issue #38970
This commit is contained in:
parent
7172fd48e9
commit
f0901a9512
@ -4965,8 +4965,13 @@ begin
|
|||||||
if IsFunction then begin
|
if IsFunction then begin
|
||||||
if (CurPos.Flag=cafColon) then begin
|
if (CurPos.Flag=cafColon) then begin
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
AtomIsIdentifierSaveE(20180411194218);
|
if UpAtomIs('SPECIALIZE') then begin
|
||||||
ReadNextAtom;
|
ReadSpecialize(true);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
AtomIsIdentifierSaveE(20180411194218);
|
||||||
|
ReadNextAtom;
|
||||||
|
end;
|
||||||
if CurPos.Flag=cafPoint then begin
|
if CurPos.Flag=cafPoint then begin
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
AtomIsIdentifierSaveE(20180411194221);
|
AtomIsIdentifierSaveE(20180411194221);
|
||||||
|
26
components/codetools/tests/laztests/bug38970.pas
Normal file
26
components/codetools/tests/laztests/bug38970.pas
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
program bug38970;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
{$modeswitch nestedprocvars}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}
|
||||||
|
Classes
|
||||||
|
{ you can add units after this };
|
||||||
|
|
||||||
|
type
|
||||||
|
generic TOption<T> = record
|
||||||
|
end;
|
||||||
|
|
||||||
|
generic TIterNestedFunc<T> = function (): specialize TOption{declaration:TOption}<T> is nested;
|
||||||
|
|
||||||
|
procedure Test;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user