Skip to content

Failure to parse array annotation argument from Scala 2 dependency #14223

Closed
@14sxlin

Description

@14sxlin

I am using a scala 2.13 library Kantan ("com.nrinaudo" % "kantan.csv-commons" % "0.6.2" cross CrossVersion.for3Use2_13) in scala 3.1.0 of cross version.

When I try to provide a implicit instance the compiler crashes. (Using given has the same result.)

Did I do something wrong ? Or Any Idea? I think the library may have used some scala 2 macro so it won't compile in scala 3. If that is true , it will be better if we has more specific compile error output.

I found this may help : scalacenter/bloop#1272

Compiler version

scalaVersion: 3.1.0
sbt: 1.6.1

Minimized code

full demo: https://github.com/14sxlin/compileerror

In build.sbt

val scala3Version = "3.1.0"

lazy val root = project
  .in(file("."))
  .settings(
    name := "compileerrordemo",
    version := "0.1.0-SNAPSHOT",
    scalaVersion := scala3Version,
    libraryDependencies += "com.nrinaudo" % "kantan.csv-commons" % "0.6.2" cross CrossVersion.for3Use2_13
  )

In Main.scala

import kantan.csv.CellEncoder

@main def encode: Unit =

  implicit val cellEncoder = new CellEncoder[String] {
    override def encode(str: String): String =
      str
  }

Output

[error] Found:    Seq[scala.annotation.Annotation]
[error] Required: Array[String]
[error] one error found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

There is no useful info in compile output.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions