typelevel / typelevel/typelevel-scalafix

Add warning for `fa.map(g).as(x)` or `fa.map(g).void`

Open
#155 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
27
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Accidentally using .as or .void after a .map is currently an undetectable category of bug, and it's a common and easy mistake to make (the former map should probably be a flatMap)

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 by locating the existing Scalafix rules and tests for method chains involving map, as, or void. Confirm how warnings are expressed and tested, then cover fa.map(g).as(x) and fa.map(g).void so the accidental map usage is reported. Done means the warning behavior is exercised by regression tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.