diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-19 09:40:08 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-19 09:40:08 +0000 |
commit | e49af12110c326811a00250a21dacca3d5931df5 (patch) | |
tree | 22e0c817053c6dec01e3803b6434474adae25dd8 /src/compiler | |
parent | c72713c16f50809a95fa6cc9e121c1c88bbb93ff (diff) | |
download | scala-e49af12110c326811a00250a21dacca3d5931df5.tar.gz scala-e49af12110c326811a00250a21dacca3d5931df5.tar.bz2 scala-e49af12110c326811a00250a21dacca3d5931df5.zip |
The fix for -explaintypes having gone off the d...
The fix for -explaintypes having gone off the deep end. Perhaps other
good may come of it as well. Review by odersky.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 5f9696c71d..28ef540ff0 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -311,11 +311,13 @@ trait Definitions extends reflect.generic.StandardDefinitions { def tupleField(n: Int, j: Int) = getMember(TupleClass(n), "_" + j) def isTupleType(tp: Type): Boolean = isTupleType(tp, false) def isTupleTypeOrSubtype(tp: Type): Boolean = isTupleType(tp, true) - private def isTupleType(tp: Type, subtypeOK: Boolean): Boolean = cond(tp.normalize) { - case t @ TypeRef(_, sym, elems) => - elems.length <= MaxTupleArity && - (sym == TupleClass(elems.length) || - subtypeOK && !tp.isHigherKinded && (t <:< TupleClass(elems.length).tpe)) + private def isTupleType(tp: Type, subtypeOK: Boolean) = tp.normalize match { + case TypeRef(_, sym, args) => + args.length <= MaxTupleArity && { + val tsym = TupleClass(args.length) + (sym == tsym) || (subtypeOK && !tp.isHigherKinded && sym.isSubClass(tsym)) + } + case _ => false } def tupleType(elems: List[Type]) = |