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/Signature.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/Signature.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Signature.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Signature.scala b/compiler/src/dotty/tools/dotc/core/Signature.scala index b2e627cbe..fcd1e2376 100644 --- a/compiler/src/dotty/tools/dotc/core/Signature.scala +++ b/compiler/src/dotty/tools/dotc/core/Signature.scala @@ -4,6 +4,8 @@ package core import Names._, Types._, Contexts._, StdNames._ import TypeErasure.sigName +import scala.annotation.tailrec + /** The signature of a denotation. * Overloaded denotations with the same name are distinguished by * their signatures. A signature of a method (of type PolyType,MethodType, or ExprType) is @@ -41,7 +43,7 @@ case class Signature(paramsSig: List[TypeName], resSig: TypeName) { * equal or on of them is tpnme.Uninstantiated. */ final def consistentParams(that: Signature): Boolean = { - def loop(names1: List[TypeName], names2: List[TypeName]): Boolean = + @tailrec def loop(names1: List[TypeName], names2: List[TypeName]): Boolean = if (names1.isEmpty) names2.isEmpty else names2.nonEmpty && consistent(names1.head, names2.head) && loop(names1.tail, names2.tail) loop(this.paramsSig, that.paramsSig) |