diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-19 09:47:37 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-19 09:47:37 +0000 |
commit | ab276e195a5f2a2b15f01ff8862cb49dc98b4cd1 (patch) | |
tree | 9ae38757e6cca6ab56a68b0fee3d07f9654fa9c3 /src | |
parent | e49af12110c326811a00250a21dacca3d5931df5 (diff) | |
download | scala-ab276e195a5f2a2b15f01ff8862cb49dc98b4cd1.tar.gz scala-ab276e195a5f2a2b15f01ff8862cb49dc98b4cd1.tar.bz2 scala-ab276e195a5f2a2b15f01ff8862cb49dc98b4cd1.zip |
Reverting the previous patch for output change ...
Reverting the previous patch for output change breakage. No review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 28ef540ff0..5f9696c71d 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -311,13 +311,11 @@ 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) = 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 + 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)) } def tupleType(elems: List[Type]) = |