You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defcalculateSum(i: List[Int]):Int=
i matchcaseNil=>0case head :: tail => head + calculateSum(tail)
Now try to move the cursor to i before match and try to remove it using backspace.
Output
Scala REPL crashes with the following stacktrace
| iException in thread "main" java.lang.AssertionError: assertion failed
| at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
| at dotty.tools.dotc.util.Spans$Span$.start$extension(Spans.scala:44)
at dotty.tools.dotc.parsing.Parsers$Parser.matchClause(Parsers.scala:2114)
at dotty.tools.dotc.parsing.Parsers$Parser.recur$4(Parsers.scala:955)
at dotty.tools.dotc.parsing.Parsers$Parser.infixOps(Parsers.scala:964)
at dotty.tools.dotc.parsing.Parsers$Parser.postfixExprRest(Parsers.scala:2209)
at dotty.tools.dotc.parsing.Parsers$Parser.postfixExpr(Parsers.scala:2199)
at dotty.tools.dotc.parsing.Parsers$Parser.expr1(Parsers.scala:2044)
at dotty.tools.dotc.parsing.Parsers$Parser.expr(Parsers.scala:1937)
at dotty.tools.dotc.parsing.Parsers$Parser.$init$$$anonfun$5(Parsers.scala:1903)
at dotty.tools.dotc.parsing.Parsers$Parser.subPart(Parsers.scala:600)
at dotty.tools.dotc.parsing.Parsers$Parser.subExpr(Parsers.scala:1905)
at dotty.tools.dotc.parsing.Parsers$Parser.defDefOrDcl(Parsers.scala:3358)
at dotty.tools.dotc.parsing.Parsers$Parser.defOrDcl(Parsers.scala:3249)
at dotty.tools.dotc.parsing.Parsers$Parser.localDef(Parsers.scala:3930)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq$$anonfun$1(Parsers.scala:3954)
at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:477)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq(Parsers.scala:3960)
at dotty.tools.dotc.printing.SyntaxHighlighting$.highlight(SyntaxHighlighting.scala:124)
at dotty.tools.repl.JLineTerminal$Highlighter.highlight(JLineTerminal.scala:80)
at org.jline.reader.impl.LineReaderImpl.getHighlightedBuffer(LineReaderImpl.java:4071)
at org.jline.reader.impl.LineReaderImpl.getDisplayedBufferWithPrompts(LineReaderImpl.java:4010)
at org.jline.reader.impl.LineReaderImpl.redisplay(LineReaderImpl.java:3879)
at org.jline.reader.impl.LineReaderImpl.doCleanup(LineReaderImpl.java:2566)
at org.jline.reader.impl.LineReaderImpl.cleanup(LineReaderImpl.java:2557)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:727)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:468)
at dotty.tools.repl.JLineTerminal.readLine(JLineTerminal.scala:72)
at dotty.tools.repl.ReplDriver.readLine$1(ReplDriver.scala:140)
at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:150)
at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:155)
at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:174)
at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:155)
at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:117)
at dotty.tools.repl.Main$.main(Main.scala:6)
at dotty.tools.MainGenericRunner$.run$1(MainGenericRunner.scala:137)
at dotty.tools.MainGenericRunner$.main(MainGenericRunner.scala:175)
at dotty.tools.MainGenericRunner.main(MainGenericRunner.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at coursier.bootstrap.launcher.a.a(Unknown Source)
at coursier.bootstrap.launcher.Launcher.main(Unknown Source)
Expectation
I can remove the i and the REPL waits for my final input.
The text was updated successfully, but these errors were encountered:
The issue seems to be when there is no identifier before match. If we have a name like list, we can remove any characters as long as one character will exist. After removing the last character, the REPL crashes.
SethTisue
changed the title
REPL craches when trying to delete match operand in longer statement
REPL crashes when trying to delete match operand in longer statement
Sep 27, 2021
Compiler version
3.1.0-RC1
Minimized code
Paste/Type into the REPL following code:
Now try to move the cursor to
i
beforematch
and try to remove it usingbackspace
.Output
Scala REPL crashes with the following stacktrace
Expectation
I can remove the
i
and the REPL waits for my final input.The text was updated successfully, but these errors were encountered: