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 crash with tab completion - invalid prefix ExprType #12600

Closed
bishabosha opened this issue May 25, 2021 · 0 comments · Fixed by #13368
Closed

REPL crash with tab completion - invalid prefix ExprType #12600

bishabosha opened this issue May 25, 2021 · 0 comments · Fixed by #13368
Assignees
Milestone

Comments

@bishabosha
Copy link
Member

bishabosha commented May 25, 2021

Compiler version

3.0.1 repl

Minimized code

// command 1
import quoted.*
// command 2
def fooImpl(using Quotes): Expr[Int] = {
  import quotes.reflect.*
  TypeRepr.of[Int].<tab>
}

Output (click arrow to expand)

Exception in thread "main" java.lang.AssertionError: assertion failed: invalid prefix ExprType(TypeRef(TermRef(TermRef(NoPrefix,val x$1),val reflect),trait ConstantTypeMethods))
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:2025)
	at dotty.tools.dotc.core.Types$TermRef.<init>(Types.scala:2567)
	at dotty.tools.dotc.core.Types$CachedTermRef.<init>(Types.scala:2646)
	at dotty.tools.dotc.core.Uniques$NamedTypeUniques.newType$1(Uniques.scala:42)
	at dotty.tools.dotc.core.Uniques$NamedTypeUniques.enterIfNew(Uniques.scala:53)
	at dotty.tools.dotc.core.Types$TermRef$.apply(Types.scala:2697)
	at dotty.tools.dotc.interactive.Completion$$anon$3.applyOrElse(Completion.scala:326)
	at dotty.tools.dotc.interactive.Completion$$anon$3.applyOrElse(Completion.scala:326)
	at scala.collection.immutable.List.collect(List.scala:267)
	at scala.collection.immutable.List.collect(List.scala:79)
	at dotty.tools.dotc.interactive.Completion$Completer.extractMemberExtensionMethods$2$$anonfun$1(Completion.scala:326)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.collection.immutable.List.flatMap(List.scala:79)
	at dotty.tools.dotc.interactive.Completion$Completer.extractMemberExtensionMethods$1(Completion.scala:326)
	at dotty.tools.dotc.interactive.Completion$Completer.extensionCompletions(Completion.scala:347)
	at dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:243)
	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)
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.

4 participants