Skip to content

Commit d93e631

Browse files
committed
Accommodate Scala 2 annotation value
1 parent 95e9d55 commit d93e631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object Annotations {
3838
if (i < args.length) Some(args(i)) else None
3939
}
4040
def argumentConstant(i: Int)(using Context): Option[Constant] =
41-
for (case ConstantType(c) <- argument(i) map (_.tpe.widenTermRefExpr.normalized)) yield c
41+
for case ConstantType(c) <- argument(i).map(arg => stripCast(arg).tpe.widenTermRefExpr.normalized) yield c
4242

4343
def argumentConstantString(i: Int)(using Context): Option[String] =
4444
for (case Constant(s: String) <- argumentConstant(i)) yield s

0 commit comments

Comments
 (0)