Skip to content

Copy Keyword does not work on Dynamic Arrays, only string #225

Description

@Schmitty2005
Program copyarr;

Type 

  Tar = Array Of Byte;

Var 
  a, b, c : Tar;
  x : Byte;
Begin
  setLength(a, 5);
  setLength(b, 5);

  For x := 0 To 4 Do
    Begin
      a[x] := x * x + 1;
      b[x] := x + 1;
    End;

  writeln(a[2]) ;
  c := copy(a, low(a), high(a));

  writeln(c[2]);
End.

Compiles and works in FPC

in Blaise :

$ ./blaise --source copyarr.pas --output arr
Semantic error: Type mismatch in assignment: expected 'array of Byte' but got 'string' at line 22 col 3 in copyarr

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions