Solved: ForStatement in aspect causes error on island

The code to reproduce (minimal code to reproduce): (1.6 MB)

The Cirrus project “aspecttest” defines the aspect “testAspect”.
This aspect generates the code (Mercury syntax):

Dim i As Integer
For i = 0 to 10

And puts this as body for every method that this aspect is applied to.

This aspect is applied to the empty method “test” in class1 in the MultiTargetLibrary
When I compile to Echoes.Full, everything compiles.
The build log: buildlog3.txt (51.1 KB)
The result of this compile (from the decompiler):

That means that the aspect has been applied successfully.

Update - not only WebAssembly: But when I compile for any Island target I get the error:

The build log: buildlog.txt (38.0 KB)

Update: On any Toffee target I get the error:

The build log: buildlog2.txt (50.8 KB)

Update: it works only on Cooper and all Echoes targets.

Update: just tested with an Oxygene class instead of a mercury class, with the same results.

Thanks, logged as bugs://85060

It’s not the for statement. It’s the System.Int32 type that doesn’t exist on the other platforms. This will properly fail now.

1 Like

bugs://85060 got closed with status fixed.