summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 9ae56f05a3..2fcce5f5db 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -175,6 +175,13 @@ trait SyntheticMethods extends ast.TreeDSL {
def makeTrees(acc: Symbol, cpt: Type): (Tree, Bind) = {
val varName = context.unit.fresh.newName(clazz.pos.focus, acc.name + "$")
val (eqMethod, binding) =
+ if (isRepeatedParamType(cpt)) (nme.sameElements, Star(WILD()))
+ else (nme.EQ , WILD() )
+
+ ((varName DOT eqMethod)(Ident(acc)), varName BIND binding)
+/** The three lines above were replaced by the following to fix #2867. But this makes lift fail, because
+ * an explicitly given type paramter violates its bound. Not sure what to do here.
+ *
if (isRepeatedParamType(cpt))
(TypeApply(varName DOT nme.sameElements, List(TypeTree(cpt.baseType(SeqClass).typeArgs.head))),
Star(WILD()))
@@ -182,6 +189,7 @@ trait SyntheticMethods extends ast.TreeDSL {
((varName DOT nme.EQ): Tree,
WILD())
(eqMethod APPLY Ident(acc), varName BIND binding)
+ */
}
// Creates list of parameters and a guard for each