File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import typer.Nullables
1414import transform .SymUtils ._
1515import core .Decorators .{given _ }
1616import config .SourceVersion
17- import StdNames .str
1817
1918class CompilationUnit protected (val source : SourceFile ) {
2019
@@ -27,9 +26,6 @@ class CompilationUnit protected (val source: SourceFile) {
2726 /** Is this the compilation unit of a Java file */
2827 def isJava : Boolean = source.file.name.endsWith(" .java" )
2928
30- /** Is this the compilation unit of a REPL input */
31- def isREPL : Boolean = source.file.name.startsWith(str.REPL_SESSION_LINE )
32-
3329 /** The source version for this unit, as determined by a language import */
3430 var sourceVersion : Option [SourceVersion ] = None
3531
@@ -53,7 +49,7 @@ class CompilationUnit protected (val source: SourceFile) {
5349 var suspended : Boolean = false
5450
5551 /** Can this compilation unit be suspended */
56- def isSuspendable : Boolean = ! isREPL
52+ def isSuspendable : Boolean = true
5753
5854 /** Suspends the compilation unit by thowing a SuspendException
5955 * and recoring the suspended compilation unit
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ class ReplCompiler extends Compiler {
146146 val objectTermName = ctx.source.file.toString.toTermName
147147 objectNames.update(defs.state.objectIndex, objectTermName)
148148
149- val unit = CompilationUnit (ctx.source)
149+ val unit = new ReplCompilationUnit (ctx.source)
150150 unit.untpdTree = wrapped(defs, objectTermName, span)
151151 unit
152152 }
Original file line number Diff line number Diff line change 1+ package dotty .tools .repl
2+
3+ import dotty .tools .dotc .CompilationUnit
4+ import dotty .tools .dotc .util .SourceFile
5+
6+
7+ class ReplCompilationUnit (source : SourceFile ) extends CompilationUnit (source):
8+ override def isSuspendable : Boolean = false
You can’t perform that action at this time.
0 commit comments