From e327bbb7bf463195c7eccaa2a399f283a849fdab Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 21 May 2008 18:00:03 +0000 Subject: correction to meaning of operator names: names ... correction to meaning of operator names: names starting with = always never count as assignment operators. Fixed #905 --- src/compiler/scala/tools/nsc/symtab/StdNames.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/scala/tools/nsc/symtab/StdNames.scala b/src/compiler/scala/tools/nsc/symtab/StdNames.scala index 7ddc641f6f..16eb6dd01b 100644 --- a/src/compiler/scala/tools/nsc/symtab/StdNames.scala +++ b/src/compiler/scala/tools/nsc/symtab/StdNames.scala @@ -99,7 +99,7 @@ trait StdNames { def isOpAssignmentName(name: Name) = name(name.length - 1) == '=' && isOperatorCharacter(name(0)) && - name != EQraw && name != NEraw && name != LEraw && name != GEraw + name(0) != '=' && name != NEraw && name != LEraw && name != GEraw def isOperatorCharacter(c: Char) = c match { case '~' | '!' | '@' | '#' | '%' | diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 71a6ceeb34..ce461952e1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3482,7 +3482,10 @@ trait Typers { self: Analyzer => } try { // if (!isLocal) tree setSymbol info.sym - val isView = (pt0 ne pt) + val isView = pt0 match { + case MethodType(_, _) | PolyType(_, _) => true + case _ => false + } val tree1 = if (isView) typed1(Apply(tree, List(Ident("") setType pt0.paramTypes.head)), EXPRmode, pt0.resultType) -- cgit v1.2.3