PLCgen crashes on nested arrays
The following CIF model:
uncontrollable u;
plant a:
disc list[2] list[3] bool x;
location:
initial;
edge u do x[1][1] := true;
end
Crashes for code generation using default settings of PLCgen:
java.lang.AssertionError
at org.eclipse.escet.common.java.Assert.check(Assert.java:38)
at org.eclipse.escet.cif.plcgen.generators.DefaultTypeGenerator.convertType(DefaultTypeGenerator.java:115)
at org.eclipse.escet.cif.plcgen.generators.DefaultVariableStorage.addStateVariable(DefaultVariableStorage.java:75)
at org.eclipse.escet.cif.plcgen.targets.PlcBaseTarget.generate(PlcBaseTarget.java:245)
at org.eclipse.escet.cif.plcgen.CifPlcGenApp.runInternal(CifPlcGenApp.java:167)
at org.eclipse.escet.common.app.framework.Application.runApplication(Application.java:315)
at org.eclipse.escet.common.app.framework.Application.run(Application.java:180)
at org.eclipse.escet.common.eclipse.ui.BaseFileCommandHandler.run(BaseFileCommandHandler.java:261)
at org.eclipse.escet.common.eclipse.ui.BaseFileCommandHandler$1.run(BaseFileCommandHandler.java:102)
at java.base/java.lang.Thread.run(Thread.java:840)
It crashes on the following line:
Assert.check(!(arrayType.getElementType() instanceof ListType)); // TODO Multi-dimensional or nested arrays.
It appears we miss a precondition check. Nested arrays are also not yet listed in the documentation as being not supported.
Addresses #679
Edited by Dennis Hendriks