diff options
author | Paul Phillips <paulp@improving.org> | 2009-07-15 04:11:42 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-07-15 04:11:42 +0000 |
commit | 370817ac9736f67775a150f679bb5a4c01356ecb (patch) | |
tree | 773e97a8e54d0484228e13cd613b5fc248608e9f /src | |
parent | 93ba5d929347647d77e20f6e003f575b60ff8fda (diff) | |
download | scala-370817ac9736f67775a150f679bb5a4c01356ecb.tar.gz scala-370817ac9736f67775a150f679bb5a4c01356ecb.tar.bz2 scala-370817ac9736f67775a150f679bb5a4c01356ecb.zip |
Fix and test case for #1110.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index e05bed9682..7819ced3c2 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -408,7 +408,14 @@ abstract class CleanUp extends Transform with ast.TreeDSL { /* ### CALLING THE APPLY -> one for operators (see above), one for normal methods ### */ def callAsOperator(paramTypes: List[Type], resType: Type): Tree = localTyper typed { def default = callAsMethod(paramTypes, resType) - if (getPrimitiveReplacementForStructuralCall isDefinedAt ad.symbol.name) { + // This is more indirect than it should be (and I don't think it spots every + // case either) but it's the most direct way I could see to address ticket #1110 + // given the information available from this vantage. + def useOperator = + (getPrimitiveReplacementForStructuralCall isDefinedAt ad.symbol.name) && + ((resType :: paramTypes) forall (x => isValueClass(x.typeSymbol))) + + if (useOperator) { val (operator, test) = getPrimitiveReplacementForStructuralCall(ad.symbol.name) def args = qual :: fixParams(params, paramTypes) |