Skip to content

Bad symbolic reference when a java classfile refers to an annotation inner class not on the classpath #13523

Closed
@n3f4s

Description

@n3f4s

Compiler version

Compiler version: 3.1.0-RC1

Minimized code

object Bot extends App {
  val token = sys.env("DISCORD_TEST_BOT")
  val gid = sys.env("GUILD_ID")
  val client: GatewayDiscordClient = (DiscordClient.create(token).login().block())
  val pingCmd = (ApplicationCommandRequest.builder()
                   .name ("ping")
                   .description ("Test ping command")
                   .build)

  val restClient = client.getRestClient
  val appId = restClient.getApplicationId.block

  (restClient
     .getApplicationService
     .createGuildApplicationCommand (appId, Snowflake.asLong(gid), pingCmd)
     .doOnError (err  println(s"Can't create command: ${err}"))
     .onErrorResume (e  Mono.empty())
     .block)

  (client
     on new ReactiveEventAdapter() {
       val cooldown_table = Map[Long, ZonedDateTime]()

       override def onSlashCommand(evt: SlashCommandEvent) = {
         if(evt.getCommandName() == "ping") {
         val reply = evt
           .getInteraction()
           .getMember()
           .toScala
           .map(mem  { "pong" })
           .getOrElse("Error: no member")
           evt.reply(reply)
         } else {
           Mono.empty()
         }
       }
     }
     blockLast)
}

Output

[error] Bad symbolic reference. A signature
[error] refers to Value/T in package org.immutables.value which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling the signature.
[warn] Caught: java.lang.AssertionError: assertion failed: failure to resolve inner class:
[warn] externalName = org.immutables.value.Value$Immutable,
[warn] outerName = org.immutables.value.Value,
[warn] innerName = Immutable
[warn] owner.fullName = org.immutables.value.Value
[warn] while parsing ~/.cache/coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/com/discord4j/discord4j-core/3.2.0-SNAPSHOT/discord4j-core-3.2.0-20210908.030540-190.jar(discord4j/core/spec/InteractionApplicationCommandCallbackReplyMonoGenerator.class) while parsing annotations in ~/.cache/coursier/v1/https/oss.sonatype.org/content/repositories/snapshots/com/discord4j/discord4j-core/3.2.0-SNAPSHOT/discord4j-core-3.2.0-20210908.030540-190.jar(discord4j/core/spec/InteractionApplicationCommandCallbackReplyMonoGenerator.class)
[warn] 5 warnings found

Expectation

The code compiles (and run as expected) with the Scala 2 compiler but give me this error message when compiling with the Scala 3 compiler.

The full code and sbt build file can be found here: https://github.com/n3f4s/scala3D4j3.2ErrorMWE

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions