From 80ad0e7b375c5abb573dbd9f488b7a21bb6184c8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 21 Jan 2010 19:27:39 +0000 Subject: Fix for #2867 undone, review by extempore. --- src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.3