From 0580641b2e3bee999691a92eaba8e59e73d33154 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 22 Jan 2008 14:28:32 +0000 Subject: fixed #360 --- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 5e16274eed..c4eba1f7b5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -147,7 +147,13 @@ trait Infer { // throw new DeferredNoInstance(() => // "no solution exists for constraints"+(tvars map boundsString)) } - for (val tvar <- tvars) assert(tvar.constr.inst != tvar, tvar.origin) + for (val tvar <- tvars) + if (tvar.constr.inst == tvar) + if (tvar.origin.typeSymbol.info eq ErrorType) { + // this can happen if during solving a cyclic type paramater + // such as T <: T gets completed. See #360 + tvar.constr.inst = ErrorType + } else assert(false, tvar.origin) tvars map instantiate } -- cgit v1.2.3