Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL crashes at completion if type parameter is omitted #12465

Closed
ansvonwa opened this issue May 13, 2021 · 2 comments · Fixed by #13700
Closed

REPL crashes at completion if type parameter is omitted #12465

ansvonwa opened this issue May 13, 2021 · 2 comments · Fixed by #13700
Assignees
Milestone

Comments

@ansvonwa
Copy link
Member

Compiler version

3.0.0

Minimized code

scala> ???.asInstanceOf[scala.collection.Seq].<tab>

Note:

  • The type parameter of s.c.Seq is omitted (Repl does not crash if it is given)
  • The REPL does not crash if the type alias from Predef is used instead (Seq instead of scala.collection.Seq)
  • The <tab> means that the tab key is pressed for completion after the ..
  • May be related to Compiler freezes if type parameter is omitted #12466

Output (click arrow to expand)

An AssertionError occurs and the REPL exits

Exception in thread "main" java.lang.AssertionError: assertion failed: found: ???.asInstanceOf[scala.collection.Seq]: collection.Seq, expected: Any
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.<init>(Implicits.scala:1091)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionTargets(Completion.scala:413)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionMemberCompletions(Completion.scala:301)
	at dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:242)
	at dotty.tools.dotc.interactive.Completion$.computeCompletions(Completion.scala:115)
	at dotty.tools.dotc.interactive.Completion$.completions(Completion.scala:49)
	at dotty.tools.repl.ReplDriver.completions$$anonfun$1(ReplDriver.scala:203)
	at scala.util.Either.map(Either.scala:382)
	at dotty.tools.repl.ReplDriver.completions(ReplDriver.scala:204)
	at dotty.tools.repl.ReplDriver.$anonfun$3(ReplDriver.scala:128)
	at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4412)
	at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4378)
	at org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4317)
	at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3809)
	at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:679)
	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:133)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:143)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:148)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:167)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:148)
	at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:114)
	at dotty.tools.repl.Main$.main(Main.scala:6)
	at dotty.tools.repl.Main.main(Main.scala)
@bishabosha
Copy link
Member

maybe this is fixed by #13368?

@SethTisue
Copy link
Member

no such luck, it still crashes even on current master

Exception in thread "main" java.lang.AssertionError: assertion failed: found: ???.asInstanceOf[scala.collection.Seq]: collection.Seq, expected: Any
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.<init>(Implicits.scala:1110)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionTargets(Completion.scala:396)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionMemberCompletions(Completion.scala:283)
	at dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:224)
	at dotty.tools.dotc.interactive.Completion$.computeCompletions(Completion.scala:118)
	at dotty.tools.dotc.interactive.Completion$.completions(Completion.scala:49)
	at dotty.tools.repl.ReplDriver.completions$$anonfun$1(ReplDriver.scala:210)
	at scala.util.Either.map(Either.scala:382)
	at dotty.tools.repl.ReplDriver.completions(ReplDriver.scala:211)
	at dotty.tools.repl.ReplDriver.$anonfun$3(ReplDriver.scala:136)
	at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4412)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants