aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index ba8dde62d..98def3071 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -816,14 +816,11 @@ object SymDenotations {
enclClass(symbol, false)
}
- final def isEffectivelyFinal(implicit ctx: Context): Boolean = {
- (this.flags is Flags.PrivateOrFinal) || (!this.owner.isClass) ||
- ((this.owner.flags is (Flags.ModuleOrFinal)) && (!this.flags.is(Flags.MutableOrLazy))) ||
- (this.owner.isAnonymousClass)
- }
+ /** A symbol is effectively final if it cannot be overridden in a subclass */
+ final def isEffectivelyFinal(implicit ctx: Context): Boolean =
+ is(PrivateOrFinal) || !owner.isClass || owner.is(ModuleOrFinal) || owner.isAnonymousClass
- /** The class containing this denotation which has the given effective name.
- */
+ /** The class containing this denotation which has the given effective name. */
final def enclosingClassNamed(name: Name)(implicit ctx: Context): Symbol = {
val cls = enclosingClass
if (cls.effectiveName == name || !cls.exists) cls else cls.owner.enclosingClassNamed(name)