Fix for Mantis #25600.

ptype.pas, read_named_type.array_dec:
  * generate a valid range definition if we are inside a generic and the array bounds are not ordinals (Note: the check for "parse_generic" should be improved to really detect erratic indexes that are not related to generics in any way)

+ added test

git-svn-id: trunk@27532 -
This commit is contained in:
svenbarth 2014-04-11 14:57:23 +00:00
parent 02495c17bd
commit b0670ee34c
3 changed files with 24 additions and 1 deletions

1
.gitattributes vendored
View File

@ -13897,6 +13897,7 @@ tests/webtbs/tw25398.pp svneol=native#text/plain
tests/webtbs/tw2540.pp svneol=native#text/plain
tests/webtbs/tw25551.pp svneol=native#text/plain
tests/webtbs/tw25598.pp svneol=native#text/plain
tests/webtbs/tw25600.pp svneol=native#text/pascal
tests/webtbs/tw25603.pp svneol=native#text/pascal
tests/webtbs/tw2561.pp svneol=native#text/plain
tests/webtbs/tw25610.pp -text svneol=native#text/plain

View File

@ -1286,7 +1286,10 @@ implementation
end
else
if not parse_generic then
Message(type_e_cant_eval_constant_expr);
Message(type_e_cant_eval_constant_expr)
else
{ we need a valid range for debug information }
range_to_type(lowval,highval,indexdef);
end
else
Message(sym_e_error_in_type_def)

19
tests/webtbs/tw25600.pp Normal file
View File

@ -0,0 +1,19 @@
{ %NORUN }
{ %OPT=-g }
program tw25600;
{$MODE DELPHI}
type
// maybe related to
// http://bugs.freepascal.org/view.php?id=25599
// http://bugs.freepascal.org/view.php?id=24848
TC<T> = class
public
class var F: array[0..T.X] of byte; // for normal fields all is ok
end;
begin // Fatal: Internal error 200601281
end.