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

Error Expected TermName but got example.MyObject[$]._$_$_$_$ #446

Open
mrdziuban opened this issue Nov 18, 2024 · 1 comment
Open

Error Expected TermName but got example.MyObject[$]._$_$_$_$ #446

mrdziuban opened this issue Nov 18, 2024 · 1 comment

Comments

@mrdziuban
Copy link

When trying to load a package's declarations I get the error below. Unfortunately I haven't been able to come up with a minimal reproduction, but I'll keep trying.

tastyquery.Exceptions$TastyFormatException: Expected TermName but got example.MyObject[$]._$_$_$_$
	at tastyquery.reader.tasties.TastyUnpickler$NameTable.simple(TastyUnpickler.scala:46)
	at tastyquery.reader.tasties.TastyUnpickler.readName(TastyUnpickler.scala:95)
	at tastyquery.reader.tasties.TastyUnpickler.readUnsignedName(TastyUnpickler.scala:97)
	at tastyquery.reader.tasties.TastyUnpickler.$anonfun$1(TastyUnpickler.scala:154)
	at tastyquery.reader.tasties.TastyReader.until(TastyReader.scala:141)
	at tastyquery.reader.tasties.TastyUnpickler.readNameContents(TastyUnpickler.scala:154)
	at tastyquery.reader.tasties.TastyUnpickler.$init$$$anonfun$1(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyUnpickler.$init$$$anonfun$adapted$1(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyReader.until(TastyReader.scala:141)
	at tastyquery.reader.tasties.TastyUnpickler.<init>(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyUnpickler.<init>(TastyUnpickler.scala:90)
	at tastyquery.reader.Loaders$PackageLoadingInfo.doLoadTasty(Loaders.scala:173)
	at tastyquery.reader.Loaders$PackageLoadingInfo.tryLoadRoot(Loaders.scala:107)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots$$anonfun$1$$anonfun$1(Loaders.scala:47)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots$$anonfun$1(Loaders.scala:47)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadingRoots(Loaders.scala:92)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots(Loaders.scala:46)
	at tastyquery.Symbols$.tastyquery$Symbols$PackageSymbol$$_$declarations$$anonfun$1(Symbols.scala:1929)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at tastyquery.Symbols$PackageSymbol.loadingNewRoots(Symbols.scala:1876)
	at tastyquery.Symbols$PackageSymbol.declarations(Symbols.scala:1929)
	at rs$line$3$.$init$$$anonfun$1(rs$line$3:1)
	at scala.util.Try$.apply(Try.scala:217)
	at rs$line$3$.<clinit>(rs$line$3:1)
	at rs$line$3.t(rs$line$3)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at dotty.tools.repl.Rendering.$anonfun$4(Rendering.scala:120)
	at scala.Option.flatMap(Option.scala:283)
	at dotty.tools.repl.Rendering.valueOf(Rendering.scala:120)
	at dotty.tools.repl.Rendering.renderVal(Rendering.scala:160)
	at dotty.tools.repl.ReplDriver.$anonfun$7(ReplDriver.scala:402)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at dotty.tools.repl.ReplDriver.extractAndFormatMembers$1(ReplDriver.scala:402)
	at dotty.tools.repl.ReplDriver.renderDefinitions$$anonfun$2(ReplDriver.scala:440)
	at scala.Option.map(Option.scala:242)
	at dotty.tools.repl.ReplDriver.renderDefinitions(ReplDriver.scala:439)
	at dotty.tools.repl.ReplDriver.compile$$anonfun$2(ReplDriver.scala:342)
	at scala.util.Either.fold(Either.scala:197)
	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:324)
	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:283)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:196)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:199)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:238)
	at dotty.tools.repl.ReplDriver.runBody$$anonfun$1(ReplDriver.scala:212)
	at dotty.tools.runner.ScalaClassLoader$.asContext(ScalaClassLoader.scala:80)
	at dotty.tools.repl.ReplDriver.runBody(ReplDriver.scala:212)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:199)
	at xsbt.ConsoleInterface.run(ConsoleInterface.java:52)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at sbt.internal.inc.AnalyzingCompiler.invoke(AnalyzingCompiler.scala:329)
	at sbt.internal.inc.AnalyzingCompiler.console(AnalyzingCompiler.scala:233)
	at sbt.Console.console0$1(Console.scala:65)
	at sbt.Console.$anonfun$apply$5(Console.scala:75)
	at sbt.Run$.executeSuccess(Run.scala:187)
	at sbt.Console.$anonfun$apply$4(Console.scala:75)
	at sbt.internal.util.Terminal.withRawInput(Terminal.scala:146)
	at sbt.internal.util.Terminal.withRawInput$(Terminal.scala:144)
	at sbt.internal.util.Terminal$ProxyTerminal$.withRawInput(Terminal.scala:434)
	at sbt.Console.$anonfun$apply$3(Console.scala:75)
	at sbt.internal.util.Terminal$TerminalImpl.withRawOutput(Terminal.scala:1038)
	at sbt.internal.util.Terminal$ProxyTerminal$.withRawOutput(Terminal.scala:473)
	at sbt.Console.apply(Console.scala:72)
	at sbt.Console.apply(Console.scala:50)
	at sbt.Console.apply(Console.scala:42)
	at sbt.Defaults$.$anonfun$consoleTask$1(Defaults.scala:2279)
	at sbt.Defaults$.$anonfun$consoleTask$1$adapted(Defaults.scala:2265)
	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
	at sbt.Execute.work(Execute.scala:292)
	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
@mrdziuban
Copy link
Author

This seems to be related to lazy implicits. With some refactoring in my code I'm now getting this error:

tastyquery.Exceptions$TastyFormatException: Expected a signature name but got example.MyObject$._$_$_$_$[unique $_lazy_implicit_$ 2]
	at tastyquery.reader.tasties.TastyUnpickler$NameTable.signatureName(TastyUnpickler.scala:78)
	at tastyquery.reader.tasties.TastyUnpickler.readSignatureName(TastyUnpickler.scala:120)
	at tastyquery.reader.tasties.TastyUnpickler.readNameContents(TastyUnpickler.scala:162)
	at tastyquery.reader.tasties.TastyUnpickler.$init$$$anonfun$1(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyUnpickler.$init$$$anonfun$adapted$1(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyReader.until(TastyReader.scala:141)
	at tastyquery.reader.tasties.TastyUnpickler.<init>(TastyUnpickler.scala:191)
	at tastyquery.reader.tasties.TastyUnpickler.<init>(TastyUnpickler.scala:90)
	at tastyquery.reader.Loaders$PackageLoadingInfo.doLoadTasty(Loaders.scala:173)
	at tastyquery.reader.Loaders$PackageLoadingInfo.tryLoadRoot(Loaders.scala:107)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots$$anonfun$1$$anonfun$1(Loaders.scala:47)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots$$anonfun$1(Loaders.scala:47
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadingRoots(Loaders.scala:92)
	at tastyquery.reader.Loaders$PackageLoadingInfo.loadAllRoots(Loaders.scala:46)
	at tastyquery.Symbols$.tastyquery$Symbols$PackageSymbol$$_$declarations$$anonfun$1(Symbols.scala:1929)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at tastyquery.Symbols$PackageSymbol.loadingNewRoots(Symbols.scala:1876)
	at tastyquery.Symbols$PackageSymbol.declarations(Symbols.scala:1929)
	at bondlink.FindUnusedGivens$.symGivens(FindUnused.scala:182)
	at bondlink.FindUnusedGivens$.main(FindUnused.scala:69)
	at bondlink.FindUnusedGivens.main(FindUnused.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

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

No branches or pull requests

1 participant