diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-06 14:48:28 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-06 15:33:13 -0800 |
commit | f39537a369e3b137f5b1bef21cc8f5d86bc9d9d8 (patch) | |
tree | c655fb315741d30c59594b0f6a4758898ec89d70 /src/compiler | |
parent | dd14b6a9b8b3355fae847f7fc8c1fc7d41babaa5 (diff) | |
download | scala-f39537a369e3b137f5b1bef21cc8f5d86bc9d9d8.tar.gz scala-f39537a369e3b137f5b1bef21cc8f5d86bc9d9d8.tar.bz2 scala-f39537a369e3b137f5b1bef21cc8f5d86bc9d9d8.zip |
Fix for crasher during type inference.
Well, "fix" is pretty generous, how about "workaround".
It does seem to do the job. Closes SI-4070, review by @moors.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 2bd307e31a..295b66b17f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1447,8 +1447,17 @@ trait Infer { /** A traverser to collect type parameters referred to in a type */ object freeTypeParamsOfTerms extends SymCollector { - protected def includeCondition(sym: Symbol): Boolean = - sym.isAbstractType && sym.owner.isTerm + // An inferred type which corresponds to an unknown type + // constructor creates a file/declaration order-dependent crasher + // situation, the behavior of which depends on the state at the + // time the typevar is created. Until we can deal with these + // properly, we can avoid it by ignoring type parameters which + // have type constructors amongst their bounds. See SI-4070. + protected def includeCondition(sym: Symbol) = ( + sym.isAbstractType + && sym.owner.isTerm + && !sym.info.bounds.exists(_.typeParams.nonEmpty) + ) } /** A traverser to collect type parameters referred to in a type |