Closed KimBruce closed 4 years ago
Fixed in commit ba9524d, which also adds a test.
There is just one superclass
slot in the parse node for an object, so the second inherit
statement was simply overwriting the first. The fix is to check that there is no existing inherit
statement before storing the one that has just been parsed.
Consider the following incorrect program:
The mistake is that we are inheriting from two classes, which is illegal. The minimal correction for this is to change one of the two "inherit" statements to "use" (changing a class to a trait is technically optional, but not enforced). The problem is the error message:
There should be a check to rule out the multiple inheritance, rather than just silently dropping the first inherit statement.