Skip to content

Commit

Permalink
Only retain @field-bearing annotations on fields
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Dec 12, 2022
1 parent caf73bf commit aa1bc24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Memoize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
denot match {
case fieldDenot: SymDenotation if sym.annotations.nonEmpty =>
val cpy = fieldDenot.copySymDenotation()
cpy.annotations = sym.annotations
cpy.annotations = atPhase(typerPhase)(sym.annotationsCarrying(defn.FieldMetaAnnot))
cpy.installAfter(thisPhase)
case _ => ()
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run/i12492.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inspecting field fieldName1 @MyColumnBase
inspecting field fieldName2 @MyColumnBase
inspecting field getterName1 @MyColumnBase
inspecting field getterName2 @MyColumnBase
inspecting field getterName1
inspecting field getterName2
inspecting method fieldName1
inspecting method fieldName2
inspecting method getterName1 @MyColumnBase
Expand Down
4 changes: 2 additions & 2 deletions tests/run/i15318.check
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inspecting field value @JsonProperty
inspecting field value2 @JsonProperty
inspecting field value
inspecting field value2
inspecting method getValue @JsonProperty
inspecting method getValue2 @JsonProperty
inspecting method setValue
Expand Down

0 comments on commit aa1bc24

Please sign in to comment.