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

Bad symbolic reference. A signature compilation error #8849

Closed
chungonn opened this issue May 1, 2020 · 3 comments
Closed

Bad symbolic reference. A signature compilation error #8849

chungonn opened this issue May 1, 2020 · 3 comments
Assignees

Comments

@chungonn
Copy link

chungonn commented May 1, 2020

The code compiles in Scala 2.13.1 but emits error on dotty 0.24.0-RC1

Minimized code

build.sbt

val dottyVersion = "0.24.0-RC1"

lazy val root = project
  .in(file("."))
  .settings(
    name := "dotty-simple",
    version := "0.1.0",

    scalaVersion := dottyVersion,

    libraryDependencies ++= Seq(
      "org.threeten" % "threeten-extra" % "1.5.0",
      "com.novocode" % "junit-interface" % "0.11" % "test",
      "ch.epfl.lamp" %% "dotty-staging" % scalaVersion.value
    )
  )

code

def toMyInterval(value: String): org.threeten.extra.Interval = org.threeten.extra.Interval.parse(value)

object Interval310 {
  def main(args: Array[String]): Unit = {
    println("hello world")
  }
}

Output

[info] Compiling 1 Scala source to /home/chungonn/development/scala3/explore/dotty-project-template/target/scala-0.24/classes ...
[error] Bad symbolic reference. A signature
[error] refers to FromString/T in package org.joda.convert 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.
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed 1 May, 2020 2:05:19 PM

Expectation

@griggt
Copy link
Contributor

griggt commented Oct 20, 2020

Alternative minimization without the threeten-extra dependency:

foo/Foo.java

package foo;

import org.joda.convert.FromString;

public final class Foo {
    @FromString
    public static Foo parse(CharSequence t) { throw new UnsupportedOperationException(); }
}

test.scala

import foo.Foo

object Test {
  val bar = Foo.parse("")
}
$ javac -classpath $JARS/joda-convert-2.2.1.jar foo/Foo.java

# note: joda-convert-2.2.1.jar not on dotc classpath
$ dotc test.scala
Bad symbolic reference. A signature
refers to FromString/T in package org.joda.convert 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.
1 error found

@griggt
Copy link
Contributor

griggt commented Oct 20, 2020

This is a duplicate of #8554 which is fixed by #9096.

@smarter Do you feel that the test you wrote for #9096 is sufficient to close this issue?

@smarter
Copy link
Member

smarter commented Oct 20, 2020

Yeah seems like this is the same.

@smarter smarter closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants