mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 06:39:36 +02:00
* hack around the -intconst hack in pexpr when recording tokens, resolves #9471
git-svn-id: trunk@8734 -
This commit is contained in:
parent
77ecd141e6
commit
6e5ff9b825
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8467,6 +8467,7 @@ tests/webtbs/tw9347a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9347b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9384.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9385.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9471.pp -text
|
||||
tests/webtbs/tw9667.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9672.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9673.pp -text
|
||||
|
@ -1902,6 +1902,12 @@ In case not, the value returned can be arbitrary.
|
||||
_INTCONST,
|
||||
_REALNUMBER :
|
||||
begin
|
||||
{ pexpr.pas messes with pattern in case of negative integer consts,
|
||||
see around line 2562 the comment of JM; remove the - before recording it
|
||||
(FK)
|
||||
}
|
||||
if (token=_INTCONST) and (pattern[1]='-') then
|
||||
delete(pattern,1,1);
|
||||
recordtokenbuf.write(pattern[0],1);
|
||||
recordtokenbuf.write(pattern[1],length(pattern));
|
||||
end;
|
||||
|
27
tests/webtbs/tw9471.pp
Normal file
27
tests/webtbs/tw9471.pp
Normal file
@ -0,0 +1,27 @@
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic GList<_T> = class
|
||||
var private
|
||||
i : integer;
|
||||
function some_func(): integer;
|
||||
end;
|
||||
|
||||
function GList.some_func(): integer;
|
||||
begin
|
||||
i := -1;
|
||||
Result := -1;
|
||||
end { some_func };
|
||||
|
||||
|
||||
type
|
||||
TA = specialize GList<integer>;
|
||||
var
|
||||
A : TA;
|
||||
|
||||
begin
|
||||
A:=TA.Create;
|
||||
if A.some_func<>-1 then
|
||||
halt(1);
|
||||
writeln('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user