diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 6d36c77b28..655e5dfe09 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -724,11 +724,15 @@ trait Implicits { */ private def companionImplicits(tp: Type): Infoss = { val partMap = new LinkedHashMap[Symbol, Type] + val seen = mutable.HashSet[Type]() // cycle detection /** Enter all parts of `tp` into `parts` set. * This method is performance critical: about 2-4% of all type checking is spent here */ def getParts(tp: Type) { + if (seen(tp)) + return + seen += tp tp match { case TypeRef(pre, sym, args) => if (sym.isClass) { |