We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95e9d55 commit d93e631Copy full SHA for d93e631
compiler/src/dotty/tools/dotc/core/Annotations.scala
@@ -38,7 +38,7 @@ object Annotations {
38
if (i < args.length) Some(args(i)) else None
39
}
40
def argumentConstant(i: Int)(using Context): Option[Constant] =
41
- for (case ConstantType(c) <- argument(i) map (_.tpe.widenTermRefExpr.normalized)) yield c
+ for case ConstantType(c) <- argument(i).map(arg => stripCast(arg).tpe.widenTermRefExpr.normalized) yield c
42
43
def argumentConstantString(i: Int)(using Context): Option[String] =
44
for (case Constant(s: String) <- argumentConstant(i)) yield s
0 commit comments