Skip to content

Commit

Permalink
Fix failure to resolve refs up class hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
jtackaberry committed Jul 25, 2021
1 parent 4a60ee6 commit 14f8712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,11 @@ def _resolve_ref(self, name):
# Qualifying the name with the current context's scope was a bust, so now
# look for it in the global space.
ref = self.refs.get(name)
if not ref and self.ctx.ref.type == 'class':
if not ref and self.ctx.ref.topref.type == 'class':
# Not found in global or context's scope, but if the current context is a
# class then we also search up the class's hierarchy. (The current ref may
# be a section so we don't use it, rather use the ref's scope.)
hierarchy = self.refs.get(self.ctx.ref.name).hierarchy
hierarchy = self.refs.get(self.ctx.ref.topref.name).hierarchy
for cls in reversed(hierarchy):
ref = self.refs.get(cls.name + '.' + name)
if ref:
Expand Down

0 comments on commit 14f8712

Please sign in to comment.