From ca6593383faa7a62ad682259b087cd2ddebb8c56 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 17 May 2021 18:24:36 +0200 Subject: [PATCH] Replace useless @SerialVersionUID error by a warning akka has this annotations on some traits and cannot remove it without breaking binary-compatibility on 2.12, they worked around this error by using a compiler plugin, but we can just downgrade the error to warning so they don't have to keep doing something that horrifying. --- compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala | 2 +- tests/{neg => neg-custom-args/fatal-warnings}/i8427.scala | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{neg => neg-custom-args/fatal-warnings}/i8427.scala (100%) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index 43a926001456..f67cd84ecdd0 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -206,7 +206,7 @@ trait BCodeSkelBuilder extends BCodeHelpers { val optSerial: Option[Long] = claszSymbol.getAnnotation(defn.SerialVersionUIDAnnot).flatMap { annot => if (claszSymbol.is(Trait)) { - report.error("@SerialVersionUID does nothing on a trait", annot.tree.sourcePos) + report.warning("@SerialVersionUID does nothing on a trait", annot.tree.sourcePos) None } else { val vuid = annot.argumentConstant(0).map(_.longValue) diff --git a/tests/neg/i8427.scala b/tests/neg-custom-args/fatal-warnings/i8427.scala similarity index 100% rename from tests/neg/i8427.scala rename to tests/neg-custom-args/fatal-warnings/i8427.scala