assigning new created array to array with 2 dimension
Issue #212
resolved
for array with 1 dimension all is ok, otherwise error. Error msg: (25:14): Incompatible types: Cannot assign "array [0..3] of ByteTyp" to "array of Integer"
Code for reproduce error attached.
program test1;
type ByteTyp = Integer;
var
arr : array of integer;
arr2Dim : array of array of integer;
function GetByteType : ByteTyp;
begin
Result := 99;
end;
begin
//thats ok
arr.SetLength(4);
arr := [GetByteType(), $13BE, $0487, 567];
AddToSystemJournal (arr[0]); //AddToSystemJournal = symlink to WriteLn
//but that - no!
arr2Dim.SetLength(2);
for var i := 0 to Length(arr2Dim) - 1 do
arr2Dim[i].SetLength(3);
arr2Dim[0] := [GetByteType(), $13BE, $0487, 567];
AddToSystemJournal (arr2Dim[0,3]); //AddToSystemJournal = symlink to WriteLn
end.
Comments (3)
-
-
repo owner Note: passes if declaration changed to
var arr2DimB : array of array of ByteTyp;
-
repo owner - changed status to resolved
Fixed Issue
#212allow TConvStaticArrayToDynamicExpr when elements are compatible, not just when of same type + test→ <<cset e7bd147817d1>>
- Log in to comment
forgot to log in to BitBucket.