-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug
When creating a Map, it is necessary to have the keys that are ordered.
However, the generated code does not have the ordering trait.
To reproduce
The following example gives code that does not compile.
Epoch:
NEWTYPESTRUCT: U32
ChainInfo:
STRUCT:
- onemap:
MAP:
KEY:
TYPENAME: Epoch
VALUE:
TYPENAME: EpochThe generated rust code will not compile due to the lack of Ord and Eq trait assignments. I have not tested but the code should also fail for C++ since C++ requires the operator< to be implemented. Other languages likely have similar issues.
Expected Behavior
There are several ways to address this issue:
- One is to implement the ordering functions whenever they are needed.
- One is to liberally implement the types.
- Identify when a type implements a map over a type containing some floating number and indicate it as invalid.
Additional context
Add any other context about the problem here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working