Closed jakhog closed 6 years ago
Currently, this nonsensical piece of ThingML code is accepted by the compilers as valid code:
datatype MyByte<1> @c_type "uint8_t"; datatype MyInt<2> @c_type "uint16_t"; datatype MyInt<1> @c_type "uint8_t"; thing MyThing { message MyByteMessage( p : MyByte ); message MyIntMessage( p : MyInt ); message MyIntMessage( p : MyByte ); property MyProperty : MyByte property MyProperty : MyInt required port MyPort { sends MyByteMessage } required port MyPort { sends MyIntMessage } provided port MyPort { receives MyIntMessage } function MyFunction() : MyByte do end function MyFunction() : MyInt do end statechart MyStates init MyState { state MyState {} state MyState {} } } configuration MyConfiguration { instance MyInstance : MyThing instance MyInstance : MyThing }
In my mind, the parser should not allow for multiple definitions with the same name like this 🙃
There are tests for this now, and most of them succeed
Currently, this nonsensical piece of ThingML code is accepted by the compilers as valid code:
In my mind, the parser should not allow for multiple definitions with the same name like this 🙃