Skip to content

Implicit lookup failing for Scala.js under Scala 3 #12424

@Rich2

Description

@Rich2

I originally posted a version of this suspected bug in the Scala.js issue tracker, but was told to repost it here. I have created a simplified repository of my main repository here. This repository is created from the openstrat. The code compiles for Jvm but is failing for Scala.js. There are 2 modules Util and Graphics. Util compiles under all 4 combinations of Js and Jvm targets and Scala 2.13.6 and Scala 3.0.1-RC2. The graphics module fails for Scala.js on Scala 3. In Sbt

graphicsJvm2/compile //compiles
graphicsJvm3/compile //compiles
graphicsJs2/compile //compiles
graphicsJs3/compile //gives the errors below

using Scala 2.13.6 and 3.0.1-RC2

The difference seems to be about implicit look up. If the 2 errors are eliminated, new implicit look up errors appear.

[info] compiling 177 Scala sources to /Common/jvmjs/graphicsJs3/target/scala-3.0.1-RC2/classes ...
[error] -- Error: /Common/jvmjs/srcGraphics/Trans/ProlignMatrix.scala:48:50 ------------
[error] 48 |    (arrA : Arr[A], prolignMatrix: ProlignMatrix) => arrA.map(a => ev.prolignObj(a, prolignMatrix))
[error]    |                                                                         ^ 
[error]    |bridge generated for member method prolignObj(arrA: ostrat.Arr[A], prolignMatrix: ostrat.geom.ProlignMatrix): ostrat.Arr[A] in anonymous class Object with ostrat.geom.Prolign {...}
[error]    |which overrides method prolignObj(obj: A, prolignMatrix: ostrat.geom.ProlignMatrix): A in trait Prolign
[error]    |clashes with definition of the member itself; both have erased type (arrA: Object, prolignMatrix: ostrat.geom.ProlignMatrix): Object."
[error] -- Error: /Common/jvmjs/srcGraphics/Trans/Slate.scala:28:84 --------------------
[error] 28 |  implicit def arrImplicit[A](implicit ev: Slate[A]): Slate[Arr[A]] = (obj, dx, dy) => obj.smap(ev.SlateXYT(_, dx, dy))
[error]    |                                                                                                                       ^
[error]    |bridge generated for member method SlateXYT(obj: ostrat.Arr[A], dx: Double, dy: Double): ostrat.Arr[A] in anonymous class Object with ostrat.geom.Slate {...}
[error]    |which overrides method SlateXYT(obj: T, xDelta: Double, yDelta: Double): T in trait Slate
[error]    |clashes with definition of the member itself; both have erased type (obj: Object, dx: Double, dy: Double): Object."

[error] two errors found
[error] two errors found
[error] (graphicsJs3 / Compile / compileIncremental) Compilation failed
[error] Total time: 3 s, completed 28 Jun 2021, 10:30:12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions