Skip to content

Commit d7cffe3

Browse files
committed
Use standard annotation format for dollarvalues
enum companions define the following: val $values: Array[E] @unchecked = ... currently the @unchecked annotation is represented as New(typeOf[scala.unchecked]) it should be Apply(Select(New(typeOf[scala.unchecked]), <init>), Nil)
1 parent b5a1715 commit d7cffe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object DesugarEnums {
125125
// Singleton enum values always construct a new anonymous class, which will not be checked by the init-checker,
126126
// so this warning will always persist even if the implementation of the anonymous class is safe.
127127
// TODO: remove @unchecked after https://github.com/lampepfl/dotty-feature-requests/issues/135 is resolved.
128-
Annotated(ArrayLiteral(enumValues, rawEnumClassRef), New(ref(defn.UncheckedAnnot.typeRef)))
128+
Annotated(ArrayLiteral(enumValues, rawEnumClassRef), New(ref(defn.UncheckedAnnot.typeRef), Nil))
129129
ValDef(nme.DOLLAR_VALUES, TypeTree(), uncheckedValues)
130130
.withFlags(Private | Synthetic)
131131

0 commit comments

Comments
 (0)