TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
102 stars 33 forks source link

Error with String parameter in java compiler #115

Closed nharrand closed 7 years ago

nharrand commented 8 years ago

CustomPrint for java in HEADS tutorials does not compile anymore:

java.lang.ClassCastException: org.sintef.thingml.impl.ObjectTypeImpl cannot be cast to org.sintef.thingml.PrimitiveType
        at org.thingml.compilers.java.JavaThingImplCompiler.generateMessages(JavaThingImplCompiler.java:98)
        at org.thingml.compilers.java.JavaThingImplCompiler.generateImplementation(JavaThingImplCompiler.java:496)
        at org.thingml.compilers.java.JavaCompiler.do_call_compiler(JavaCompiler.java:106)
        at org.thingml.compilers.utils.OpaqueThingMLCompiler.compile(OpaqueThingMLCompiler.java:65)
        at org.thingml.compilers.commandline.Main.main(Main.java:192)
nharrand commented 8 years ago

It's probably caused by the on going work on serialization. JavaThingImplCompiler.java:98 seems to assume that parameter type are always datatype and never object, which is a requirement only for messages exchanged over network, but not for internal communications.

brice-morin commented 8 years ago

Yes indeed. Should be easy to fix.