diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/classfile/ClassfileParser.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 9ea24324b..25558a79a 100644 --- a/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -438,7 +438,14 @@ class ClassfileParser( case None => hasError = true } if (hasError) None - else if (skip) None else Some(JavaSeqLiteral(arr.toList)) + else if (skip) None + else { + val elems = arr.toList + val elemType = + if (elems.isEmpty) defn.ObjectType + else ctx.typeComparer.lub(elems.tpes).widen + Some(JavaSeqLiteral(elems, TypeTree(elemType))) + } case ANNOTATION_TAG => parseAnnotation(index, skip) map (_.tree) } |