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
14
14
import transform .SymUtils ._
15
15
import core .Decorators .{given _ }
16
16
import config .SourceVersion
17
- import StdNames .str
18
17
19
18
class CompilationUnit protected (val source : SourceFile ) {
20
19
@@ -27,9 +26,6 @@ class CompilationUnit protected (val source: SourceFile) {
27
26
/** Is this the compilation unit of a Java file */
28
27
def isJava : Boolean = source.file.name.endsWith(" .java" )
29
28
30
- /** Is this the compilation unit of a REPL input */
31
- def isREPL : Boolean = source.file.name.startsWith(str.REPL_SESSION_LINE )
32
-
33
29
/** The source version for this unit, as determined by a language import */
34
30
var sourceVersion : Option [SourceVersion ] = None
35
31
@@ -53,7 +49,7 @@ class CompilationUnit protected (val source: SourceFile) {
53
49
var suspended : Boolean = false
54
50
55
51
/** Can this compilation unit be suspended */
56
- def isSuspendable : Boolean = ! isREPL
52
+ def isSuspendable : Boolean = true
57
53
58
54
/** Suspends the compilation unit by thowing a SuspendException
59
55
* and recoring the suspended compilation unit
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ class ReplCompiler extends Compiler {
146
146
val objectTermName = ctx.source.file.toString.toTermName
147
147
objectNames.update(defs.state.objectIndex, objectTermName)
148
148
149
- val unit = CompilationUnit (ctx.source)
149
+ val unit = new ReplCompilationUnit (ctx.source)
150
150
unit.untpdTree = wrapped(defs, objectTermName, span)
151
151
unit
152
152
}
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