Skip to content

Commit 40c7af3

Browse files
committed
Quick-fix #2704, to get Olaf unblocked.
This is not a proper fix, it just fixes the crash. We need to figure out why this happens and handle it correctly.
1 parent 7cf6409 commit 40c7af3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
224224
def shouldEmitAnnotation(annot: Annotation): Boolean = {
225225
annot.symbol.isJavaDefined &&
226226
retentionPolicyOf(annot) != AnnotationRetentionSourceAttr &&
227-
annot.args.isEmpty
227+
annot.args.isEmpty &&
228+
!annot.tree.isInstanceOf[Block] // unblocking Olaf, needs a proper fix
228229
}
229230

230231
private def retentionPolicyOf(annot: Annotation): Symbol =
@@ -527,6 +528,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
527528

528529
def assocsFromApply(tree: Tree) = {
529530
tree match {
531+
case Block(_, expr) => assocsFromApply(expr)
530532
case Apply(fun, args) =>
531533
fun.tpe.widen match {
532534
case MethodType(names) =>

0 commit comments

Comments
 (0)