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

Interactive - completions on scala.quoted.Quotes.reflectModule.Term fails #13365

Closed
dos65 opened this issue Aug 23, 2021 · 2 comments · Fixed by #13368
Closed

Interactive - completions on scala.quoted.Quotes.reflectModule.Term fails #13365

dos65 opened this issue Aug 23, 2021 · 2 comments · Fixed by #13368
Milestone

Comments

@dos65
Copy link
Contributor

dos65 commented Aug 23, 2021

3.0.1

Originally reported in metals repo
Calling a completions on tree from the last line fails:

import scala.quoted._

object Test {
  def test(using Quotes)(str: String) = {
    import quotes.reflect._
    val msg = Expr(str)
    msg.sh@@ow // works well
    val printHello = '{ print($msg) }
    val tree = printHello.asTerm 
    tree.sh@@ // doesn't work
  }
}

Error:

Exception in thread "pool-3-thread-11" java.lang.AssertionError: assertion failed: invalid prefix ExprType(TypeRef(TermRef(TermRef(NoPrefix,val x$2),val reflect),trait AnnotatedMethods))
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:2043)
	at dotty.tools.dotc.core.Types$TermRef.<init>(Types.scala:2585)
	at dotty.tools.dotc.core.Types$CachedTermRef.<init>(Types.scala:2664)
	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:2715)
	at dotty.tools.dotc.interactive.Completion$$anon$3.applyOrElse(Completion.scala:305)
	at dotty.tools.dotc.interactive.Completion$$anon$3.applyOrElse(Completion.scala:305)
	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:305)
	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:305)
	at dotty.tools.dotc.interactive.Completion$Completer.extensionCompletions(Completion.scala:326)
	at dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:222)
	at dotty.tools.dotc.interactive.Completion$.computeCompletions(Completion.scala:115)
	at dotty.tools.dotc.interactive.Completion$.completions(Completion.scala:49)
	at scala.meta.internal.pc.CompletionProvider.completions(CompletionProvider.scala:39)
	at scala.meta.internal.pc.ScalaPresentationCompiler.complete$$anonfun$1(ScalaPresentationCompiler.scala:157)
	at scala.meta.internal.pc.CompilerAccess.withSharedCompiler(CompilerAccess.scala:137)
	at scala.meta.internal.pc.CompilerAccess.$anonfun$1(CompilerAccess.scala:87)
	at scala.meta.internal.pc.CompilerAccess.onCompilerJobQueue$$anonfun$1(CompilerAccess.scala:197)
	at scala.meta.internal.pc.CompilerJobQueue$Job.run(CompilerJobQueue.scala:139)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

@dos65 dos65 changed the title Interactive - completions on scala.quoted.Quotes.reflectModule.Term fails with en error Interactive - completions on scala.quoted.Quotes.reflectModule.Term fails Aug 23, 2021
@griggt
Copy link
Contributor

griggt commented Aug 23, 2021

Duplicate of #12600 ?

@dos65
Copy link
Contributor Author

dos65 commented Aug 23, 2021

@griggt You right! Thx!

@dos65 dos65 closed this as completed Aug 23, 2021
griggt added a commit to griggt/dotty that referenced this issue Aug 24, 2021
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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.

3 participants