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

[Bug][Scala 3.2] Autocomplete on Array.x produces Bad symbolic reference. #1305

Open
HamishPoole opened this issue Oct 19, 2022 · 2 comments
Labels

Comments

@HamishPoole
Copy link

HamishPoole commented Oct 19, 2022

me@pop-os:~$ amm
Loading...
Welcome to the Ammonite Repl 2.5.5 (Scala 3.2.0 Java 11.0.16.1)
@ val a = Array.tabulate(5)(_ + 1)
a: Array[Int] = Array(1, 2, 3, 4, 5)

@ val b = Array.tabjava.lang.AssertionError: assertion failed: missing implicit parameter of type scala.reflect.ClassTag[A] after typer at phase parser
  scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
  dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:995)
  dotty.tools.dotc.typer.Implicits.inferImplicit$(Implicits.scala:797)
  dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:117)
  dotty.tools.dotc.typer.Implicits.inferImplicitArg(Implicits.scala:863)
  dotty.tools.dotc.typer.Implicits.inferImplicitArg$(Implicits.scala:797)
  dotty.tools.dotc.typer.Typer.inferImplicitArg(Typer.scala:117)
  dotty.tools.dotc.typer.Typer.implicitArgs$1(Typer.scala:3490)
  dotty.tools.dotc.typer.Typer.addImplicitArgs$1(Typer.scala:3526)
  dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$1(Typer.scala:3602)
  dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3800)
  dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4038)
  dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3368)
  dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
  dotty.tools.dotc.typer.Implicits.tryConversion$1(Implicits.scala:1089)
  dotty.tools.dotc.typer.Implicits.typedImplicit(Implicits.scala:1120)
  dotty.tools.dotc.typer.Implicits.typedImplicit$(Implicits.scala:797)
  dotty.tools.dotc.typer.Typer.typedImplicit(Typer.scala:117)
  dotty.tools.dotc.typer.Implicits$ImplicitSearch.tryImplicit(Implicits.scala:1190)
  dotty.tools.dotc.typer.Implicits$ImplicitSearch.$anonfun$9(Implicits.scala:1528)
  scala.collection.immutable.List.map(List.scala:246)
  dotty.tools.dotc.typer.Implicits$ImplicitSearch.allImplicits(Implicits.scala:1528)
  dotty.tools.dotc.interactive.Completion$Completer.implicitConversionTargets(Completion.scala:521)
  dotty.tools.dotc.interactive.Completion$Completer.implicitConversionMemberCompletions(Completion.scala:386)
  dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:328)
  dotty.ammonite.compiler.AmmCompletion$.computeCompletions(AmmCompletion.scala:45)
  dotty.ammonite.compiler.AmmCompletion$.completions(AmmCompletion.scala:27)
  ammonite.compiler.Compiler.complete(Compiler.scala:385)
  ammonite.compiler.CompilerLifecycleManager.complete(CompilerLifecycleManager.scala:111)
  ammonite.repl.Repl.$anonfun$action$5(Repl.scala:192)
  ammonite.repl.Repl.$anonfun$action$5$adapted(Repl.scala:192)
  ammonite.repl.AmmoniteFrontEnd.$anonfun$readLine$3(AmmoniteFrontEnd.scala:53)
  ammonite.terminal.TTY$.withSttyOverride(Utils.scala:117)
  ammonite.repl.AmmoniteFrontEnd.$anonfun$readLine$1(AmmoniteFrontEnd.scala:53)
  ammonite.terminal.Filter$$anon$2$$anonfun$op$6.applyOrElse(Filter.scala:69)
  ammonite.terminal.Filter$$anon$2$$anonfun$op$6.applyOrElse(Filter.scala:69)
  scala.collection.IterableOnceOps.collectFirst(IterableOnce.scala:1116)
  scala.collection.IterableOnceOps.collectFirst$(IterableOnce.scala:1108)
  scala.collection.AbstractIterator.collectFirst(Iterator.scala:1300)
  ammonite.terminal.Filter$$anon$2.op(Filter.scala:69)
  ammonite.terminal.Filter$$anon$5.$anonfun$op$7(Filter.scala:93)
  scala.collection.Iterator$$anon$9.next(Iterator.scala:584)
  scala.collection.IterableOnceOps.find(IterableOnce.scala:633)
  scala.collection.IterableOnceOps.find$(IterableOnce.scala:630)
  scala.collection.AbstractIterator.find(Iterator.scala:1300)
  ammonite.terminal.Filter$$anon$5.op(Filter.scala:93)
  ammonite.terminal.LineReader.readChar(LineReader.scala:157)
  ammonite.terminal.Terminal$.$anonfun$readLine$2(Terminal.scala:41)
  ammonite.terminal.TTY$.withSttyOverride(Utils.scala:117)
  ammonite.terminal.Terminal$.readLine(Terminal.scala:41)
  ammonite.repl.AmmoniteFrontEnd.readLine(AmmoniteFrontEnd.scala:133)
  ammonite.repl.AmmoniteFrontEnd.action(AmmoniteFrontEnd.scala:28)
  ammonite.repl.Repl.$anonfun$action$4(Repl.scala:194)
  ammonite.repl.Scoped.$anonfun$flatMap$1(Signaller.scala:45)
  ammonite.repl.Signaller.apply(Signaller.scala:28)
  ammonite.repl.Scoped.flatMap(Signaller.scala:45)
  ammonite.repl.Scoped.flatMap$(Signaller.scala:45)
  ammonite.repl.Signaller.flatMap(Signaller.scala:16)
  ammonite.repl.Repl.$anonfun$action$2(Repl.scala:178)
  ammonite.util.Catching.flatMap(Res.scala:115)
  ammonite.repl.Repl.action(Repl.scala:170)
  ammonite.repl.Repl.loop$1(Repl.scala:212)
  ammonite.repl.Repl.run(Repl.scala:227)
  ammonite.Main.$anonfun$run$1(Main.scala:236)
  scala.Option.getOrElse(Option.scala:201)
  ammonite.Main.run(Main.scala:224)
  ammonite.MainRunner.$anonfun$runRepl$1(MainRunner.scala:72)
  ammonite.MainRunner.watchLoop(MainRunner.scala:53)
  ammonite.MainRunner.runRepl(MainRunner.scala:72)
  ammonite.AmmoniteMain$.main0(AmmoniteMain.scala:99)
  ammonite.AmmoniteMain$.main(AmmoniteMain.scala:38)
  ammonite.AmmoniteMain.main(AmmoniteMain.scala)


@ val c = Array.tabulate(9)(_ + 1)
Bad symbolic reference. A signature
refers to JFunction1$mcII$sp/T in package scala.runtime.java8 which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling the signature.
Compilation Failed

See above. Using tab autocompletion on the Array produces a bad symbolic reference later.

Using https://github.com/com-lihaoyi/Ammonite/releases/download/2.5.5/3.2-2.5.5

@HamishPoole HamishPoole changed the title [Scala 3.2] Autocompling Array. produces Bad symbolic reference. [Scala 3.2] Autocompling Array.x produces Bad symbolic reference. Oct 19, 2022
@HamishPoole HamishPoole changed the title [Scala 3.2] Autocompling Array.x produces Bad symbolic reference. [Bug][Scala 3.2] Autocomplete on Array.x produces Bad symbolic reference. Oct 19, 2022
@lolgab lolgab added the bug label Nov 14, 2023
@crater2150
Copy link

A similar error also occurs in Scala's own repl, also related to completion: scala/scala3#15562

@felix-alonso
Copy link

I also experienced a similar error. I was test driving the REPL and wrote this:

"hello world".toSeq.map(_.to<TAB>

And got the following stack trace:

stack trace
Exception in thread "main" java.lang.AssertionError: assertion failed: missing implicit parameter of type Ordering[scala.runtime.RichChar] after typer at phase parser
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1042)
	at dotty.tools.dotc.typer.Implicits.inferImplicit$(Implicits.scala:818)
	at dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:116)
	at dotty.tools.dotc.typer.Implicits.inferImplicitArg(Implicits.scala:884)
	at dotty.tools.dotc.typer.Implicits.inferImplicitArg$(Implicits.scala:818)
	at dotty.tools.dotc.typer.Typer.inferImplicitArg(Typer.scala:116)
	at dotty.tools.dotc.typer.Typer.implicitArgs$1(Typer.scala:3737)
	at dotty.tools.dotc.typer.Typer.addImplicitArgs$1(Typer.scala:3773)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsImplicitMethod$1(Typer.scala:3849)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:4038)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:4268)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:3587)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3184)
	at dotty.tools.dotc.typer.Implicits.tryConversion$1(Implicits.scala:1136)
	at dotty.tools.dotc.typer.Implicits.typedImplicit(Implicits.scala:1167)
	at dotty.tools.dotc.typer.Implicits.typedImplicit$(Implicits.scala:818)
	at dotty.tools.dotc.typer.Typer.typedImplicit(Typer.scala:116)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.tryImplicit(Implicits.scala:1242)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.$anonfun$6(Implicits.scala:1580)
	at scala.collection.immutable.List.map(List.scala:246)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.allImplicits(Implicits.scala:1580)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionTargets(Completion.scala:515)
	at dotty.tools.dotc.interactive.Completion$Completer.implicitConversionMemberCompletions(Completion.scala:380)
	at dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:322)
	at dotty.ammonite.compiler.AmmCompletion$.computeCompletions(AmmCompletion.scala:45)
	at dotty.ammonite.compiler.AmmCompletion$.completions(AmmCompletion.scala:27)
	at ammonite.compiler.Compiler.complete(Compiler.scala:392)
	at ammonite.compiler.CompilerLifecycleManager.complete(CompilerLifecycleManager.scala:115)
	at ammonite.repl.Repl.action$$anonfun$2$$anonfun$2$$anonfun$1(Repl.scala:199)
	at ammonite.repl.Repl.action$$anonfun$2$$anonfun$2$$anonfun$adapted$1(Repl.scala:199)
	at ammonite.repl.AmmoniteFrontEnd.$anonfun$3(AmmoniteFrontEnd.scala:53)
	at ammonite.terminal.TTY$.withSttyOverride(Utils.scala:117)
	at ammonite.repl.AmmoniteFrontEnd.$anonfun$1(AmmoniteFrontEnd.scala:54)
	at ammonite.terminal.Filter$$anon$3$$anon$4.applyOrElse(Filter.scala:69)
	at ammonite.terminal.Filter$$anon$3$$anon$4.applyOrElse(Filter.scala:69)
	at scala.collection.IterableOnceOps.collectFirst(IterableOnce.scala:1142)
	at scala.collection.IterableOnceOps.collectFirst$(IterableOnce.scala:1134)
	at scala.collection.AbstractIterator.collectFirst(Iterator.scala:1300)
	at ammonite.terminal.Filter$$anon$3.op(Filter.scala:69)
	at ammonite.terminal.Filter$.ammonite$terminal$Filter$$anon$7$$_$op$$anonfun$3(Filter.scala:93)
	at scala.collection.Iterator$$anon$9.next(Iterator.scala:584)
	at scala.collection.IterableOnceOps.find(IterableOnce.scala:634)
	at scala.collection.IterableOnceOps.find$(IterableOnce.scala:631)
	at scala.collection.AbstractIterator.find(Iterator.scala:1300)
	at ammonite.terminal.Filter$$anon$7.op(Filter.scala:93)
	at ammonite.terminal.LineReader.readChar(LineReader.scala:157)
	at ammonite.terminal.Terminal$.readLine$$anonfun$2(Terminal.scala:40)
	at ammonite.terminal.TTY$.withSttyOverride(Utils.scala:117)
	at ammonite.terminal.Terminal$.readLine(Terminal.scala:42)
	at ammonite.repl.AmmoniteFrontEnd.readLine(AmmoniteFrontEnd.scala:152)
	at ammonite.repl.AmmoniteFrontEnd.action(AmmoniteFrontEnd.scala:28)
	at ammonite.repl.Repl.action$$anonfun$2$$anonfun$2(Repl.scala:204)
	at ammonite.repl.Scoped.flatMap$$anonfun$1(Signaller.scala:45)
	at ammonite.repl.Signaller.apply(Signaller.scala:28)
	at ammonite.repl.Scoped.flatMap(Signaller.scala:45)
	at ammonite.repl.Scoped.flatMap$(Signaller.scala:42)
	at ammonite.repl.Signaller.flatMap(Signaller.scala:16)
	at ammonite.repl.Repl.action$$anonfun$2(Repl.scala:210)
	at ammonite.util.Res$Success.flatMap(Res.scala:62)
	at ammonite.repl.Repl.action(Repl.scala:210)
	at ammonite.repl.Repl.loop$1(Repl.scala:219)
	at ammonite.repl.Repl.run(Repl.scala:234)
	at ammonite.Main.run(Main.scala:248)
	at ammonite.MainRunner.runRepl$$anonfun$1(MainRunner.scala:72)
	at ammonite.MainRunner.watchLoop(MainRunner.scala:53)
	at ammonite.MainRunner.runRepl(MainRunner.scala:72)
	at ammonite.AmmoniteMain$.main0(AmmoniteMain.scala:92)
	at ammonite.AmmoniteMain$.main(AmmoniteMain.scala:31)
	at ammonite.AmmoniteMain.main(AmmoniteMain.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at coursier.bootstrap.launcher.a.a(Unknown Source)
	at coursier.bootstrap.launcher.Launcher.main(Unknown Source)

System information:

Chip: Apple M3 Pro
macOS: 14.1.1 (Sonoma)
Ammonite REPL & Script-Runner, 3.0.0-M0-59-cdeaa580
Scala code runner version 3.3.1 -- Copyright 2002-2023, LAMP/EPFL

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

No branches or pull requests

4 participants