diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index bec55720f..51e03aee7 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -470,6 +470,11 @@ object SymDenotations { final def enclosingClass(implicit ctx: Context): Symbol = if (isClass) symbol else owner.enclosingClass + final def enclosingClassNamed(name: Name)(implicit ctx: Context): Symbol = { + val cls = enclosingClass + if (cls.name == name) cls else cls.owner.enclosingClassNamed(name) + } + /** The top-level class containing this denotation, * except for a toplevel module, where its module class is returned. */ |