diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-03-01 10:11:49 +0100 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-03-01 13:03:44 +0100 |
commit | be5720c18ca6768c7e72d4258677952848db2bb4 (patch) | |
tree | a781b4f8b2772de09db54352d2d50602a1a0a4a6 /compiler/src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 1a490393d766039332bfccb8b85f264f22c9e9cc (diff) | |
download | dotty-be5720c18ca6768c7e72d4258677952848db2bb4.tar.gz dotty-be5720c18ca6768c7e72d4258677952848db2bb4.tar.bz2 dotty-be5720c18ca6768c7e72d4258677952848db2bb4.zip |
Add @tailrec to avoid regressions.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/SymDenotations.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index a3475e14c..8e3b73fc0 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1040,7 +1040,7 @@ object SymDenotations { * pre: `this.owner` is in the base class sequence of `base`. */ final def superSymbolIn(base: Symbol)(implicit ctx: Context): Symbol = { - def loop(bcs: List[ClassSymbol]): Symbol = bcs match { + @tailrec def loop(bcs: List[ClassSymbol]): Symbol = bcs match { case bc :: bcs1 => val sym = matchingDecl(bcs.head, base.thisType) .suchThat(alt => !(alt is Deferred)).symbol @@ -1056,7 +1056,7 @@ object SymDenotations { * (2) it is abstract override and its super symbol in `base` is * nonexistent or incomplete. */ - final def isIncompleteIn(base: Symbol)(implicit ctx: Context): Boolean = + @tailrec final def isIncompleteIn(base: Symbol)(implicit ctx: Context): Boolean = (this is Deferred) || (this is AbsOverride) && { val supersym = superSymbolIn(base) |