File tree 2 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/transform
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import Decorators._
69
69
val sym = tree.symbol
70
70
71
71
def newField = {
72
+ assert(! sym.hasAnnotation(defn.ScalaStaticAnnot ))
72
73
val fieldType =
73
74
if (sym.isGetter) sym.info.resultType
74
75
else /* sym.isSetter*/ sym.info.firstParamTypes.head
Original file line number Diff line number Diff line change @@ -97,8 +97,13 @@ class SymUtils(val self: Symbol) extends AnyVal {
97
97
if (self.isSetter) self
98
98
else accessorNamed(self.asTerm.name.setterName)
99
99
100
- def field (implicit ctx : Context ): Symbol =
101
- self.owner.info.decl(self.asTerm.name.fieldName).suchThat(! _.is(Method )).symbol
100
+ def field (implicit ctx : Context ): Symbol = {
101
+ val fieldName = if (self.hasAnnotation(defn.ScalaStaticAnnot )) {
102
+ self.name.asTermName.getterName
103
+ } else self.asTerm.name.fieldName
104
+
105
+ self.owner.info.decl(fieldName).suchThat(! _.is(Method )).symbol
106
+ }
102
107
103
108
def isField (implicit ctx : Context ): Boolean =
104
109
self.isTerm && ! self.is(Method )
You can’t perform that action at this time.
0 commit comments