Skip to content

Commit e057a3e

Browse files
Kordyjanliufengyun
andauthored
Wrap typed tree in special case for java annotation args
Co-authored-by: Fengyun Liu <liu@fengy.me>
1 parent d1d5826 commit e057a3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,10 @@ class Typer extends Namer
865865
*/
866866
val arg1 = pt match {
867867
case AppliedType(a, typ :: Nil) if ctx.isJava && a.isRef(defn.ArrayClass) =>
868-
tryAlternatively { typed(tree.arg, pt) } { typed(untpd.JavaSeqLiteral(tree.arg :: Nil, TypeTree(typ)), pt) }
868+
tryAlternatively { typed(tree.arg, pt) } {
869+
val elemTp = untpd.TypedSplice(TypeTree(typ))
870+
typed(untpd.JavaSeqLiteral(tree.arg :: Nil, elemTp), pt)
871+
}
869872
case _ => typed(tree.arg, pt)
870873
}
871874

0 commit comments

Comments
 (0)