From d7cffe3e88718e47feb923b363483e499f1182e1 Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Tue, 27 Oct 2020 16:08:09 +0100 Subject: [PATCH] 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]), ), Nil) --- compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index 9a61c453a987..41888539900f 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -125,7 +125,7 @@ object DesugarEnums { // Singleton enum values always construct a new anonymous class, which will not be checked by the init-checker, // so this warning will always persist even if the implementation of the anonymous class is safe. // TODO: remove @unchecked after https://github.com/lampepfl/dotty-feature-requests/issues/135 is resolved. - Annotated(ArrayLiteral(enumValues, rawEnumClassRef), New(ref(defn.UncheckedAnnot.typeRef))) + Annotated(ArrayLiteral(enumValues, rawEnumClassRef), New(ref(defn.UncheckedAnnot.typeRef), Nil)) ValDef(nme.DOLLAR_VALUES, TypeTree(), uncheckedValues) .withFlags(Private | Synthetic)