* hack around the -intconst hack in pexpr when recording tokens, resolves

git-svn-id: trunk@8734 -
This commit is contained in:
florian 2007-10-06 14:33:57 +00:00
parent 77ecd141e6
commit 6e5ff9b825
3 changed files with 34 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.