-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Currently, to pick a class name for a contract statement the following is done:
- Take the statement name
- If it collides with any other statement name (regardless of their namespace), then go one namespace up and prefix your current name with the namespace name
- Repeat step 2 until there are no more conflicts
For instance consider two statements One.Two.Three
and Four.Two.Three
where .
denotes a namespace accessor.
Then to find the class name for One.Two.Three
:
- Start with
Three
- It collides with
Four.Two.Three
, go one namespace up: set current name toTwoThree
- Still collides with
Four.Two.Three
, go one namespace up: set current name toOneTwoThree
- No collisions. Final class name is
OneTwoThree
This algorithm was chosen because Dart does not have namespaces and this algorithm produces possibly shortest names without collisions... Or so I thought.
Now consider the following statements: One.One
, OneOne
, Two.One
. If you follow the algorithm, the resulting class names will be respectively OneOne
, OneOne
, and TwoOne
. That's a name clash.
This brings us to the question: how do we want to generate names for such cases? Or, what would be a different (better) way of picking class names?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working