Skip to content

AnyRef expected type for ArraySeq#to(ArraySeq) gives error type mismatch #12188

Open
@bjornregnell

Description

@bjornregnell

reproduction steps

using Scala 2.13,

Welcome to Scala 2.13.3 (OpenJDK 64-Bit Server VM, Java 11.0.8).
Type in expressions for evaluation. Or try :help.

scala> import collection.mutable.ArraySeq
import collection.mutable.ArraySeq

scala> val as = ArraySeq(1,2,3)
val as: scala.collection.mutable.ArraySeq[Int] = ArraySeq(1, 2, 3)

scala> as eq as.to(ArraySeq)
                   ^
       error: type mismatch;
        found   : scala.collection.mutable.ArraySeq.type
        required: scala.collection.Factory[Int,AnyRef]

problem

It works on e.g.

scala> as.to(ArraySeq)
val res0: scala.collection.mutable.ArraySeq[Int] = ArraySeq(1, 2, 3)

so it is a surprise.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions