@@ -425,10 +425,14 @@ object SymDenotations {
425
425
final def isSourceMethod (implicit ctx : Context ) = this is (Method , butNot = Accessor )
426
426
427
427
/** Is this a setter? */
428
- final def isGetter (implicit ctx : Context ) = (this is Accessor ) && ! originalName.isSetterName
428
+ final def isGetter (implicit ctx : Context ) =
429
+ (this is Accessor ) && ! originalName.isSetterName && ! originalName.isScala2LocalSuffix
429
430
430
431
/** Is this a setter? */
431
- final def isSetter (implicit ctx : Context ) = (this is Accessor ) && originalName.isSetterName
432
+ final def isSetter (implicit ctx : Context ) =
433
+ (this is Accessor ) &&
434
+ originalName.isSetterName &&
435
+ info.firstParamTypes.nonEmpty // to avoid being fooled by var x_= : Unit = ...
432
436
433
437
/** is this the constructor of a class? */
434
438
final def isClassConstructor = name == nme.CONSTRUCTOR
@@ -892,8 +896,9 @@ object SymDenotations {
892
896
override def valRef (implicit ctx : Context ): TermRef =
893
897
TermRef .withSigAndDenot(owner.thisType, name.asTermName, Signature .NotAMethod , this )
894
898
895
- override def termRefWithSig (implicit ctx : Context ): TermRef =
896
- TermRef .withSigAndDenot(owner.thisType, name.asTermName, signature, this )
899
+ override def termRefWithSig (implicit ctx : Context ): TermRef = // TODO generalize
900
+ if (ctx.erasedTypes) TermRef .withFixedSym(owner.thisType, name.asTermName, symbol.asTerm)
901
+ else TermRef .withSigAndDenot(owner.thisType, name.asTermName, signature, this )
897
902
898
903
def nonMemberTermRef (implicit ctx : Context ): TermRef =
899
904
TermRef .withFixedSym(owner.thisType, name.asTermName, symbol.asTerm)
0 commit comments