Skip to content

Commit e25a5cb

Browse files
committed
Fix #3309
When auto-completing in the REPL, we sometime tried to typecheck an EmptyTree. Not anymore
1 parent b8d1e41 commit e25a5cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ class ReplCompiler(val directory: AbstractFile) extends Compiler {
246246
case Parsed(sourceCode, trees) =>
247247
wrap(trees).result
248248
case SyntaxErrors(_, reported, trees) =>
249-
if (errorsAllowed) wrap(trees).result
249+
// We cannot type check an empty tree
250+
if (errorsAllowed && !trees.head.isEmpty) wrap(trees).result
250251
else reported.errors
251252
case _ => List(
252253
new messages.Error(

0 commit comments

Comments
 (0)