maxime-esa / asn1scc

ASN1SCC: An open source ASN.1 compiler for embedded systems
https://www.thanassis.space/asn1.html
Other
269 stars 58 forks source link

[SCALA] wrong method call #281

Closed final87 closed 8 months ago

final87 commented 11 months ago

Creating Scala code from an asn1 definition with fixed size array, like this:

IntermediateDownlinkPartReport ::= SEQUENCE {  
     packetPart                                  SEQUENCE (SIZE (255)) OF INTEGER(0..255)  
}

in the Def file the class of the array is generated with a constructor accepting one parameter:

case class IntermediateUplinkPart_packetPart (arr: Array[IntermediateUplinkPart_packetPart_elem])  
{
    require(arr.length == 255)
}

but then the object is created passing two parameters

var pVal: IntermediateUplinkPart_packetPart = IntermediateUplinkPart_packetPart(0, Array.fill(255){0})`

which causes compilation error.

sfiruch commented 11 months ago

Thank you for the bug report. We'll take a look at it.

fschramka commented 11 months ago

Hi @final87

Thanks for letting us know :) This simple case was not covered by the PUS-C asn1 input.

We fixed this (and other stuff) in: https://github.com/ateleris/asn1scc/tree/scala-backend

It is only a draft right now :) Please use this branch until our work is pulled into the main repo :)