Skip to content

Commit 7a0b4b4

Browse files
committed
Avoid momoization of console files
1 parent c2a8dae commit 7a0b4b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ object ParseResult {
108108

109109
@sharable private[this] val CommandExtract = """(:[\S]+)\s*(.*)""".r
110110

111+
@sharable private[this] var i = 0
111112
private def parseStats(sourceCode: String)(implicit ctx: Context): List[untpd.Tree] = {
112-
val source = new SourceFile("<console>", sourceCode)
113+
val source = new SourceFile(s"<console$i>", sourceCode)
114+
i += 1
113115
val ctx1 = ctx.fresh.setSource(source)
114116
val parser = new Parser(source)(ctx1)
115117
val stats = parser.blockStatSeq()

0 commit comments

Comments
 (0)