@@ -3,7 +3,7 @@ package transform
3
3
4
4
import core ._
5
5
import ast .tpd ._
6
- import Contexts .Context
6
+ import Contexts ._
7
7
import SymDenotations ._
8
8
import Symbols .newSymbol
9
9
import Decorators ._
@@ -27,9 +27,9 @@ class BeanProperties(thisPhase: DenotTransformer):
27
27
def generateGetter (valDef : ValDef )(using Context ) : Tree =
28
28
val prefix = if valDef.symbol.denot.hasAnnotation(defn.BooleanBeanPropertyAnnot ) then " is" else " get"
29
29
val meth = newSymbol(
30
- owner = summon[ Context ] .owner,
30
+ owner = ctx .owner,
31
31
name = prefixedName(prefix, valDef.name),
32
- flags = Method | Permanent | Synthetic ,
32
+ flags = Method | Synthetic ,
33
33
info = MethodType (Nil , valDef.denot.info))
34
34
.enteredAfter(thisPhase).asTerm
35
35
meth.addAnnotations(valDef.symbol.annotations)
@@ -38,7 +38,7 @@ class BeanProperties(thisPhase: DenotTransformer):
38
38
39
39
def maybeGenerateSetter (valDef : ValDef )(using Context ): Option [Tree ] =
40
40
Option .when(valDef.denot.asSymDenotation.flags.is(Mutable )) {
41
- val owner = summon[ Context ] .owner
41
+ val owner = ctx .owner
42
42
val meth = newSymbol(
43
43
owner,
44
44
name = prefixedName(" set" , valDef.name),
@@ -53,9 +53,8 @@ class BeanProperties(thisPhase: DenotTransformer):
53
53
def prefixedName (prefix : String , valName : Name ) =
54
54
(prefix + valName.lastPart.toString.capitalize).toTermName
55
55
56
- extension(a : SymDenotation ) def isApplicable = a.hasAnnotation(defn.BeanPropertyAnnot ) || a.hasAnnotation(defn.BooleanBeanPropertyAnnot )
57
-
58
- if valDef.denot.symbol.isApplicable then
56
+ val symbol = valDef.denot.symbol
57
+ if symbol.hasAnnotation(defn.BeanPropertyAnnot ) || symbol.hasAnnotation(defn.BooleanBeanPropertyAnnot ) then
59
58
generateGetter(valDef) +: maybeGenerateSetter(valDef) ++: Nil
60
59
else Nil
61
60
end generateAccessors
0 commit comments