summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-03-24 16:19:25 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-03-24 16:19:25 +0000
commita2bfe6eef5294f9bd6347ab98c171db4bc6fe78d (patch)
treed1c26e6cfde619d0a9849ade49557b180d40c759 /src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
parent66f28b5aa86372c16219f9acdaf9648b93fe133f (diff)
downloadscala-a2bfe6eef5294f9bd6347ab98c171db4bc6fe78d.tar.gz
scala-a2bfe6eef5294f9bd6347ab98c171db4bc6fe78d.tar.bz2
scala-a2bfe6eef5294f9bd6347ab98c171db4bc6fe78d.zip
Fixed #1675
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
index c9d5a2ad2d..05a496cdce 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
@@ -311,16 +311,18 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
}
/** Adapt the given argument in call to protected member.
- * Adaptation means adding a cast to a path-dependent type, for instance
+ * Adaptation may add a cast to a path-dependent type, for instance
*
* def prot$m(obj: Outer)(x: Inner) = obj.m(x.asInstanceOf[obj.Inner]).
*
* such a cast might be necessary when m expects an Outer.this.Inner (the
* outer of 'obj' and 'x' have to be the same). This restriction can't be
* expressed in the type system (but is implicit when defining method m).
+ *
+ * Also, it calls using repeated parameters are ascribed with ': _*'
*/
private def makeArg(v: Symbol, obj: Symbol, expectedTpe: Type): Tree = {
- val res = Ident(v)
+ var res: Tree = Ident(v)
val sym = obj.tpe.typeSymbol
var ownerClass: Symbol = NoSymbol
@@ -330,13 +332,15 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
if (sym.isSubClass(ownerClass)) true else false
case _ => false
}
+ if (v.info.typeSymbol == definitions.RepeatedParamClass) {
+ res = gen.wildcardStar(res)
+ log("adapted to wildcard star: " + res)
+ }
if (isDependentType) {
val preciseTpe = expectedTpe.asSeenFrom(singleType(NoPrefix, obj), ownerClass) //typeRef(singleType(NoPrefix, obj), v.tpe.symbol, List())
TypeApply(Select(res, definitions.Any_asInstanceOf),
List(TypeTree(preciseTpe)))
- }
- else
- res
+ } else res
}
/** For a path-dependent type, return the this type. */