eolian: get rid of false positives about unimplemented methods
authorDaniel Kolesa <d.kolesa@samsung.com>
Wed, 23 Jan 2019 16:59:40 +0000 (17:59 +0100)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 24 Jan 2019 05:20:19 +0000 (14:20 +0900)
commitdedf81c3b10d435e3c5f2947631c1acdbeecd621
tree1ebf880366cbc1212ba495757ace1fe28ff8b0aa
parent6d77237b911393f0a68772a81422ac1d11e20d2a
eolian: get rid of false positives about unimplemented methods

We worked under the assumption that when inheriting callables
from a regular class, it's good enough to just set those as
fully implemented, because the underlying class is already
checked. This assumption is wrong, as the callables may contain
multiple implements pointing at the same function (consider when
a regular class implements just the get part of a property but
some underlying class implements it whole) - the old logic would
result in just the first reached implement (possibly incomplete)
being added into callables of the inheriting class, which results
in false positives.

Consider this example:

class A has a fully implemented property foo
class B inherits from A and partially implements foo
abstract C inherits from B
class D inherits from C

abstract C would go over B's implements, encounter the first
partial implementation of foo, adding it into its own callables
and marking it as fully implemented (because it came from an
already checked regular class B), which would result in the
other implement being skipped.

So make no assumptions and use the same logic for all class types.

Of course, this brings in another problem: some errors would now
get printed twice, because if you have a class A which has funcs
that are unimplemented and class B inheriting from it, errors would
get printed for A but also for B, which would include A's errors.

To battle that, introduce a "global" (well, local to the entry
point of the validator) hash tracking which implements have already
been errored on; and skip those appropriately.
src/lib/eolian/database_validate.c