Skip to content

sbt console tab completion broken after importing io.kjaer.compiletime._ #182

Closed
@valencik

Description

@valencik

To reproduce:

  1. run sbt backendsJVM/console
  2. once console has loaded, enter import io.kjaer.compiletime._
  3. type 1. followed by the tab key (1, period, tab) to show completions on value 1

This results in the error pasted below, but with the likely interesting part here:

Toplevel definition <init> is defined in .../io/kjaer/compiletime/dependent$package.class and also in .../io/kjaer/compiletime/IndicesOf$package.class
One of these files should be removed from the classpath.

This is the only related commentary i could find upstream: scala/scala3#11546 (comment)


info [jline] Error while finding completion candidates                               
dotty.tools.dotc.core.TypeError: Toplevel definition <init> is defined in
  /Users/andrewvalencik/grabbed/onnx-scala/common/.jvm/target/scala-3.0.0-RC1/classes/io/kjaer/compiletime/dependent$package.class
and also in
  /Users/andrewvalencik/grabbed/onnx-scala/common/.jvm/target/scala-3.0.0-RC1/classes/io/kjaer/compiletime/IndicesOf$package.class
One of these files should be removed from the classpath.
        at dotty.tools.dotc.core.SymDenotations$PackageClassDenotation.dropStale$1(SymDenotations.scala:2330)
        at dotty.tools.dotc.core.SymDenotations$PackageClassDenotation.recur$1(SymDenotations.scala:2294)
        at dotty.tools.dotc.core.SymDenotations$PackageClassDenotation.computeMembersNamed(SymDenotations.scala:2350)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.membersNamed(SymDenotations.scala:1914)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1965)
        at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:655)
        at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:843)
        at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:638)
        at dotty.tools.dotc.core.Types$Type.member(Types.scala:622)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addMember(Completion.scala:292)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addImportCompletions$$anonfun$3(Completion.scala:364)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
        at scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:889)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addImportCompletions(Completion.scala:364)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addScopeCompletions(Completion.scala:192)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addExtensionCompletions(Completion.scala:249)
        at dotty.tools.dotc.interactive.Completion$CompletionBuffer.addSelectionCompletions(Completion.scala:275)
        at dotty.tools.dotc.interactive.Completion$.computeCompletions(Completion.scala:122)
        at dotty.tools.dotc.interactive.Completion$.completions(Completion.scala:48)
        at dotty.tools.repl.ReplDriver.completions$$anonfun$1(ReplDriver.scala:188)
        at scala.util.Either.map(Either.scala:382)
        at dotty.tools.repl.ReplDriver.completions(ReplDriver.scala:189)
        at dotty.tools.repl.ReplDriver.$anonfun$3(ReplDriver.scala:113)
        at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4394)
        at org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4360)
        at org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4299)
        at org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3793)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:665)
        at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:454)
        at dotty.tools.repl.JLineTerminal.readLine(JLineTerminal.scala:71)
        at dotty.tools.repl.ReplDriver.readLine$1(ReplDriver.scala:118)
        at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:128)
        at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:133)
        at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:152)
        at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:133)
        at xsbt.ConsoleInterface.run(ConsoleInterface.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions