Page MenuHomePhabricator

eolian: Warn if a regular class appears anywhere other than the first place in an inheritance list
Closed, ResolvedPublic

Description

An Eo class can only inherit from exactly one other Eo class (which must be the first one in the inheritance list), and from any number of interfaces and mixins.

However, eolian_gen allows for regular classes to be used anywhere in the inheritance list. If they are not in the first place, though, they are treated as interfaces instead of classes. This is, only their API is used, not their implementation.

This is misleading, and we have multiple instances of this in our eo files. The problem is that we do not know if the author of the eo file was aware of this situation and was purposely using a class as an interface (easy to fix), or wasn't aware and therefore was expecting an implementation to be called, which will not happen (hard to fix).

The first step is to find out the magnitude of the problem: Make eolian_gen warn in these situations. Later on, we can promote the warning to an error and forbid inheritance from more than once class.

This has been discussed in T7240.