diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-24 09:48:26 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-24 09:48:26 +0200 |
commit | 98a5f06e3841ac988a819a4928ffd827efec221e (patch) | |
tree | 3e646be1ea2b2dfa41dc8eedff06284a17012776 | |
parent | ee5721e864de6fff2d54b9fb5452123bcca82483 (diff) | |
download | scala-98a5f06e3841ac988a819a4928ffd827efec221e.tar.gz scala-98a5f06e3841ac988a819a4928ffd827efec221e.tar.bz2 scala-98a5f06e3841ac988a819a4928ffd827efec221e.zip |
docs related to fix for SI-6111
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 4340137335..291b7f1827 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -90,8 +90,7 @@ trait Infer { if (nbSubPats == 1) if (isUnapplySeq) List(seqToRepeatedChecked(optionTArg)) else List(optionTArg) - // in principle, the spec doesn't allow just any subtype of Product, it *must* be TupleN[...] -- see run/virtpatmat_extends_product.scala - // should check `isTupleType(optionTArg)` -- this breaks plenty of stuff, though... + // TODO: update spec to reflect we allow any ProductN, not just TupleN else getProductArgs(optionTArg) match { case Nil if isUnapplySeq => List(seqToRepeatedChecked(optionTArg)) case tps if isUnapplySeq => tps.init :+ seqToRepeatedChecked(tps.last) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 8361ea9586..80e7d0d474 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2749,7 +2749,14 @@ trait Typers extends Modes with Adaptations with Tags { def typedArgs(args: List[Tree], mode: Int) = args mapConserve (arg => typedArg(arg, mode, 0, WildcardType)) - // [adriaan] as far as I can tell, formals0 is only supplied to detect whether the last formal was originally a vararg + /** Type trees in `args0` against corresponding expected type in `adapted0`. + * + * The mode in which each argument is typed is derived from `mode` and + * whether the arg was originally by-name or var-arg (need `formals0` for that) + * the default is by-val, of course. + * + * (docs reverse-engineered -- AM) + */ def typedArgs(args0: List[Tree], mode: Int, formals0: List[Type], adapted0: List[Type]): List[Tree] = { val sticky = onlyStickyModes(mode) def loop(args: List[Tree], formals: List[Type], adapted: List[Type]): List[Tree] = { |