Invalid value Boolean when array of record

Issue #223 resolved
Krzysztof created an issue

I am using an up-to-date version of DwScript, I found a case that my scripts stopped working. I found the cause which is demonstrated below.
When I define an array of record and the Boolean field is at least second in order, the value of the Boolean variable will be invalid.

type 
  TRec = record  
    S: String; // comment to be OK
    B: Boolean;
  end;

var tmpA: array of TRec;

tmpA.SetLength(1);
tmpA[0].B := True;
Assert(tmpA[0].B = True);

Comments (1)

  1. Eric Grange repo owner

    Fixed Issue #223 incorrect implementation in TArrayElementDataContext.GetAsBoolean which would manifest when a boolean field of a record in a dynamic array was read-accessed as a boolean + test

    → <<cset a1ffb463a156>>

  2. Log in to comment