diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-03-05 09:08:58 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-03-05 09:08:58 -0800 |
commit | 1176035f271821021c36d1b3cab6b2888e99524d (patch) | |
tree | 03008bb9d5ecc30512c54145a48e1dd045578480 /src/reflect/scala | |
parent | 773f6a8df9ef95852918a706f3f19ebf0431baa8 (diff) | |
parent | f482d5bdd0722e54cb3cfc2219df93da5f435bac (diff) | |
download | scala-1176035f271821021c36d1b3cab6b2888e99524d.tar.gz scala-1176035f271821021c36d1b3cab6b2888e99524d.tar.bz2 scala-1176035f271821021c36d1b3cab6b2888e99524d.zip |
Merge pull request #2193 from adriaanm/patmat-refactor
merge 2.10.1 into 2.10.x
Diffstat (limited to 'src/reflect/scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 546df8a207..f5f577677c 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -3183,12 +3183,19 @@ trait Types extends api.Types { self: SymbolTable => * ?TC[?T] <: Any * }}} */ - def unifySimple = ( - (params.isEmpty || tp.typeSymbol == NothingClass || tp.typeSymbol == AnyClass) && { + def unifySimple = { + val sym = tp.typeSymbol + if (sym == NothingClass || sym == AnyClass) { // kind-polymorphic + // SI-7126 if we register some type alias `T=Any`, we can later end + // with malformed types like `T[T]` during type inference in + // `handlePolymorphicCall`. No such problem if we register `Any`. + addBound(sym.tpe) + true + } else if (params.isEmpty) { addBound(tp) true - } - ) + } else false + } /** Full case: involving a check of the form * {{{ |