diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-02 16:33:59 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-02 16:45:48 +0200 |
commit | 24b62e616ba2d18eee0a3bbffaf5c76abc6cc4b6 (patch) | |
tree | 09ea38f75b73aa95d17fd3a97e90a9067b80cd2b | |
parent | 90d2bee45b25844f809f8c5300aefcb1bfe9e336 (diff) | |
download | scala-24b62e616ba2d18eee0a3bbffaf5c76abc6cc4b6.tar.gz scala-24b62e616ba2d18eee0a3bbffaf5c76abc6cc4b6.tar.bz2 scala-24b62e616ba2d18eee0a3bbffaf5c76abc6cc4b6.zip |
fix SI-5682
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala | 9 | ||||
-rw-r--r-- | test/files/jvm/annotations.scala | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala index 4c71772929..7dc105690c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala +++ b/src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala @@ -248,13 +248,12 @@ trait MethodSynthesis { else List(Getter(vd)) ) def beanAccessors(vd: ValDef): List[DerivedFromValDef] = { + val setter = if (vd.mods.isMutable) List(BeanSetter(vd)) else Nil if (forMSIL) Nil - else if (vd.symbol hasAnnotation BeanPropertyAttr) { - if (vd.mods.isMutable) List(BeanGetter(vd), BeanSetter(vd)) - else List(BeanGetter(vd)) - } + else if (vd.symbol hasAnnotation BeanPropertyAttr) + BeanGetter(vd) :: setter else if (vd.symbol hasAnnotation BooleanBeanPropertyAttr) - List(BooleanBeanGetter(vd)) + BooleanBeanGetter(vd) :: setter else Nil } def allValDefDerived(vd: ValDef) = { diff --git a/test/files/jvm/annotations.scala b/test/files/jvm/annotations.scala index b1c3c8ba40..66ebde592b 100644 --- a/test/files/jvm/annotations.scala +++ b/test/files/jvm/annotations.scala @@ -193,7 +193,9 @@ object Test6 { val c = new C("bob") c.setText("dylan") println(c.getText()) - if (new D(true).isProp()) { + val d = new D(true) + d.setProp(false) + if (!d.isProp()) { println(new D(false).getM()) } } |