typelevel / typelevel/fs2

`compile.to(ByteVector)` sometimes causes `java.lang.ClassCastException` in scala3

Open
#3,009 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Scala
Stars
2.5k
Forks
636
Avg merge
2d 4h
Merged PRs (30d)
7

Description

I encountered this in a cross built app and it worked for 2.12/2.13

Here is a scastie repro from @ChristopherDavenport via Discord

I attempted my own repro before I found Chris's, and to(ByteVector) worked in the case I came up with, for example

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Scastie reproduction and the compile.to(ByteVector) entry point; compare it with the working 2.12/2.13 cases and the second reproduction. Trace the Scala 3-specific failure and add a regression test covering the failing conversion. Done means the reproduction no longer throws ClassCastException while existing cases still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.