mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 17:30:34 +02:00
* fix #40708: when creating the sub-arraydefs for comma separated arrays, ensure that the new sub array also has the generic related information set up correctly
+ added test
This commit is contained in:
parent
326d92589a
commit
550397b982
@ -1623,6 +1623,10 @@ implementation
|
||||
symtablestack.pop(arrdef.symtable);
|
||||
arrdef:=tarraydef(arrdef.elementdef);
|
||||
symtablestack.push(arrdef.symtable);
|
||||
{ correctly update the generic information of the new array def }
|
||||
insert_generic_parameter_types(arrdef,genericdef,genericlist,false);
|
||||
if old_parse_generic then
|
||||
include(arrdef.defoptions,df_generic);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
14
tests/webtbs/tw40708.pp
Normal file
14
tests/webtbs/tw40708.pp
Normal file
@ -0,0 +1,14 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw40708;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type generic TMatrix4<T> = array[0..3] of array [0..3] of T; // works
|
||||
type generic TAnotherMatrix4<T> = array[0..3,0..3] of T; // "Identifier not found T"
|
||||
|
||||
type TMatrix4LongInt = specialize TMatrix4<LongInt>;
|
||||
type TAnotherMatrix4LongInt = specialize TAnotherMatrix4<LongInt>;
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user