maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Array type copy does not copy type

Open CThuleHansen opened this issue 4 years ago • 2 comments

When cloning the type here: https://github.com/INTO-CPS-Association/maestro/blob/2.0.0-alpha/plugins/fixedstep/src/main/java/org/intocps/maestro/plugin/FixedStep.java#L82 (compDecl.get().getType().clone())

the type does not contain the size of the array. This leads to the following MaBL: FMI2Component[] fix_components[AIntLiteralExp] = { wtInstance , crtlInstance };

The reason is, that the parsing of an array does not set the size on the type (AARRAYTYPE) of the vardecl.

Witness test: image

CThuleHansen avatar Oct 02 '20 10:10 CThuleHansen

I have fixed it manually by varDecl.setSize((List<? extends PExp>) compDecl.get().getSize().clone()); in order to progress, but it does not fixing the parsing issue.

CThuleHansen avatar Oct 02 '20 11:10 CThuleHansen

I actually think it is wrong to have size as a property on arraytype.

CThuleHansen avatar Oct 02 '20 11:10 CThuleHansen