Skip to content

Commit e73914c

Browse files
committed
Fix #7529: Don't assume repl input is only 2 statements
1 parent 3cb93f3 commit e73914c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/repl/CollectTopLevelImports.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CollectTopLevelImports extends Phase {
2020

2121
def run(implicit ctx: Context): Unit = {
2222
def topLevelImports(tree: Tree) = {
23-
val PackageDef(_, _ :: TypeDef(_, rhs: Template) :: Nil) = tree
23+
val PackageDef(_, _ :: TypeDef(_, rhs: Template) :: _) = tree
2424
rhs.body.collect { case tree: Import => tree }
2525
}
2626

0 commit comments

Comments
 (0)