aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-07-11 17:45:09 +0200
committerMartin Odersky <odersky@gmail.com>2014-07-17 11:02:02 +0200
commitec972b74ada750b5565028053032204e7d31417d (patch)
tree8fa9f660400bfb7a4a352927354110f76f432eb8
parent58f249d5d5acca1da3f4f2cdd417ba271d79819f (diff)
downloaddotty-ec972b74ada750b5565028053032204e7d31417d.tar.gz
dotty-ec972b74ada750b5565028053032204e7d31417d.tar.bz2
dotty-ec972b74ada750b5565028053032204e7d31417d.zip
Fix problem with dynamicSignature.
Pattern match needs to compare against list of names, not single name. Universal equality bites again... Also fix comment for ElimRepeated.
-rw-r--r--src/dotty/tools/dotc/transform/ElimRepeated.scala5
-rw-r--r--src/dotty/tools/dotc/transform/TypeUtils.scala5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/transform/ElimRepeated.scala b/src/dotty/tools/dotc/transform/ElimRepeated.scala
index be1040cac..713127ea0 100644
--- a/src/dotty/tools/dotc/transform/ElimRepeated.scala
+++ b/src/dotty/tools/dotc/transform/ElimRepeated.scala
@@ -17,8 +17,9 @@ import Names.Name
import NameOps._
import TypeUtils._
-/** A transformer that provides a convenient way to create companion objects
- */
+/** A transformer that removes repeated parameters (T*) from all types, replacing
+ * them with Seq types.
+ */
class ElimRepeated extends TreeTransform with InfoTransformer { thisTransformer =>
import ast.tpd._
diff --git a/src/dotty/tools/dotc/transform/TypeUtils.scala b/src/dotty/tools/dotc/transform/TypeUtils.scala
index 851029888..d9671a190 100644
--- a/src/dotty/tools/dotc/transform/TypeUtils.scala
+++ b/src/dotty/tools/dotc/transform/TypeUtils.scala
@@ -79,13 +79,14 @@ class TypeUtils(val self: Type) extends AnyVal {
*/
def dynamicSignature(implicit ctx: Context): Signature = self match {
case self: PolyType => self.resultType.dynamicSignature
- case self @ MethodType(nme.SELF, _) =>
+ case self @ MethodType(nme.SELF :: Nil, _) =>
val normalizedResultType = self.resultType match {
case rtp: MethodType => rtp
case rtp => ExprType(rtp)
}
normalizedResultType.signature
- case _ => Signature.NotAMethod
+ case _ =>
+ Signature.NotAMethod
}
/** The Seq type corresponding to this repeated parameter type */