Odd: Bug or feature?


I discovered something odd today.

Create a new web core project, add a button to the main form so that we have something to see.

Now create the following record in the main form unit:

  TRecord = record
     x1, x2 : array[0..4] of string;
  end;

Run the app and you'll get a blank page, comment out the fields:

  TRecord = record
     //x1, x2 : array[0..4] of string;
  end

and the form with the button is displayed. declaring the field separately gets round the issue:

  TRecord = record
     x1 : array[0..4] of string;
     x2 : array[0..4] of string;
  end;

Also if you declare this record in the implementation section (removing it from the interface section) you get a runtime error (delcare x1 and x2 separately the error goes away).

ERROR
Uncaught duplicate type "TRecord.x2$a" | 0::d 1::u 2::p 3::l 4::i 5::c 6::a 7::t 8::e 9:: 10::t 11::y 12::p 13::e 14:: 15::" 16::T 17::R 18::e 19::c 20::o 21::r 22::d 23::. 24::x 25::2 26::$ 27::a 28::"
at http://localhost:8000/Project1/Project1.js [1333:26]

We'll check this with the compiler team.

We cannot reproduce this.
Test code in a new project


implementation

{$R *.dfm}
type
 TRecord = record
     x1, x2 : array[0..4] of string;
  end;

procedure TForm1.WebButton1Click(Sender: TObject);
var
  r: TRecord;
begin
  r.x1[0] := 'abc';
end;

If a problem persists, please provide a project with which we can reproduce the issue here.

Sure, here is a link to the source code that gives the runtime error. 


https://www.dropbox.com/sh/ronzqmn82xywoi3/AACY4up4UU6cKau8D_3KYErZa?dl=0

Using the current stable 1.3 series of TMW Web Core using Delphi 10.3 Update 2

// Running on Chrome version:
// Version 83.0.4103.61 (Official Build) (64-bit)

We could see the runtime error.
The compiler team will investigate this.

Compiler team confirms the bug and is looking at fixing this issue.

Great, its easy to get round so its not a show stopper.

I can confirm the compiler team solved this issue.
The next update will address this.