Skip to content

LengthFieldFramer.apply in Scala 2.13 broken since Commit dc6680b #971

@DieBauer

Description

@DieBauer

In dc6680b a cast is added to prevent copying elements.
In scala 2.12 this is allowed, but in scala 2.13 (with the new collections API) this is incompatible.

import scala.collection.mutable.ArrayBuffer
import scala.collection.immutable.IndexedSeq

val f = new ArrayBuffer[Int]
f.asInstanceOf[IndexedSeq[Int]]

fails with java.lang.ClassCastException: class scala.collection.mutable.ArrayBuffer cannot be cast to class scala.collection.immutable.IndexedSeq (scala.collection.mutable.ArrayBuffer and scala.collection.immutable.IndexedSeq

The builds of this commit also indicate that the 2.13 finagle-core fails since.

It seems btw that no code paths hit this, but the unit tests fail.

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