Closed byakuren-hijiri closed 1 day ago
Should we consider adding a compilation error for that case?
yeah, this is definitely a bug
So, I checked and the trait copying algorithm, which inserts trait's entities into the contract, checks if a trait was already processed and ignores it. This is to make sure that multiple trait inheritance from different paths works properly. For example, MyContract
classDiagram
Fooable <|-- Bazable
Barable <|-- Bazable
MyContract <|-- Fooable
MyContract <|-- Barable
will only inherit the Bazable
trait once.
So, it means we need to just process duplicate traits in the immediate inheritance list, as the recursive case is fine and already handled.
Expected: a warning or a compilation error because we inherit the
Deployable
trait twice. Result: Successful compilation.Should we consider adding a compilation error for that case?