diff options
author | Martin Odersky <odersky@gmail.com> | 2008-01-22 14:28:32 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-01-22 14:28:32 +0000 |
commit | 0580641b2e3bee999691a92eaba8e59e73d33154 (patch) | |
tree | 4849c07e3e8548f0e780a913e2c0d827d0e4f041 | |
parent | b3f0e4bf9f5bb4766e87e6d80c82e349ee556541 (diff) | |
download | scala-0580641b2e3bee999691a92eaba8e59e73d33154.tar.gz scala-0580641b2e3bee999691a92eaba8e59e73d33154.tar.bz2 scala-0580641b2e3bee999691a92eaba8e59e73d33154.zip |
fixed #360
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 8 |
1 files changed, 7 insertions, 1 deletions
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 } |