project/plugins.sbtaddSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.0")
buid.sbtscalaVersion := "0.22.0-RC1" // compile successfully with "2.13.1"
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.30"
src/main/scala/Main.scalaimport org.slf4j.{Logger, LoggerFactory}
object Main {
def main(args: Array[String]): Unit = {
val logger: Logger = LoggerFactory.getLogger("main")
logger.error("{}{}{}", 1, 2, 3) // error here
}
}
[error] -- [E134] Type Mismatch Error: /dotty-example/src/main/scala/Main.scala:6:11
[error] 6 | logger.error("{}{}{}", 1, 2, 3) // error here
[error] | ^^^^^^^^^^^^
[error] |None of the overloaded alternatives of method error in trait Logger with types
[error] | (x$0: org.slf4j.Marker, x$1: String, x$2: Throwable): Unit
[error] | (x$0: org.slf4j.Marker, x$1: String, x$2: Object*): Unit
[error] | (x$0: org.slf4j.Marker, x$1: String, x$2: Any, x$3: Any): Unit
[error] | (x$0: org.slf4j.Marker, x$1: String, x$2: Any): Unit
[error] | (x$0: org.slf4j.Marker, x$1: String): Unit
[error] | (x$0: String, x$1: Throwable): Unit
[error] | (x$0: String, x$1: Object*): Unit
[error] | (x$0: String, x$1: Any, x$2: Any): Unit
[error] | (x$0: String, x$1: Any): Unit
[error] | (x$0: String): Unit
[error] |match arguments (("{}{}{}" : String), (1 : Int), (2 : Int), (3 : Int))
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
Compile successfully and choose this method in Logger.java:
public void error(String format, Object... arguments);
Note: Change scalaVersion := "2.13.1" in build.sbt => compile successfully
[error] | (x$0: String, x$1: Object*): Unit
This should be Any*.
Maybe fixed in #8718
Related to #8977
https://github.com/lampepfl/dotty/pull/8718 doesn't fix it. I believe #8977 is the same issue as this one, so I'll close this one in favor of #8977 since it doesn't rely on an external library.