(#14343) Lookup in correct inherited scope
The previous twoscope lookup of the inheritied scope tried to find the
inherited scope by looking up the class_scope() directly. Unfortunately,
this does not work correctly in cases where the inherited scope is
qualified to the topscope (::parent) or where the scope is implicitly
qualified (class a { class b {} class c inherits b {} }).
By using the same mechanism that variables use for looking up scope (the
qualified_scope() method) variable lookup will find a scope consistent
with what qualified variable lookups will find.