Skip to content

CollectionConverters conflicts with FunctionConverters for Seq's #11519

@joshlemer

Description

@joshlemer
scala> import scala.jdk.CollectionConverters.Ops._
import scala.jdk.CollectionConverters.Ops._

scala> import scala.jdk.FunctionConverters.Ops._
import scala.jdk.FunctionConverters.Ops._

scala> List(1,2,3).asJava
           ^
       error: type mismatch;
        found   : List[Int]
        required: ?{def asJava: ?}
       Note that implicit conversions are not applicable because they are ambiguous:
        both method SeqHasAsJava in trait AsJavaExtensions of type [A](s: scala.collection.Seq[A])jdk.CollectionConverters.Ops.SeqHasAsJava[A]
        and method enrichAsJavaIntUnaryOperator in trait Priority0FunctionExtensions of type [A0](sf: A0 => Int)(implicit evA0: A0 =:= Int)scala.jdk.FunctionWrappers.RichFunction1AsIntUnaryOperator
        are possible conversion functions from List[Int] to ?{def asJava: ?}
                   ^
       error: value asJava is not a member of List[Int]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions