New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShowSynthetics #266

Closed
olafurpg opened this Issue Jul 18, 2017 · 2 comments

Comments

Projects
None yet
1 participant
@olafurpg
Member

olafurpg commented Jul 18, 2017

It would be nice to have a rewrite that expands all sugars so that inferred type parameters/implicits are made explicit.

// before
  val x = List(1).map(_ + 1)
  x + "foobar"
// after
  val x = List.apply[Int](1).map[Int, List[Int]](_ + 1)(scala.collection.immutable.List.canBuildFrom[Int])
  scala.Predef.any2stringadd[List[Int]](x) + "foobar"

@olafurpg olafurpg added the rule label Jul 18, 2017

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg
Member

olafurpg commented Jul 18, 2017

I took some first steps towards this rewrite here: https://github.com/scalacenter/scalafix/compare/master...olafurpg:expand-sugars?expand=1

While working on this I hit on

@olafurpg olafurpg modified the milestone: v0.5.1 Sep 8, 2017

@olafurpg olafurpg changed the title from ExpandSugars rewrite to ShowSynthetics Sep 8, 2017

bmatthews68 added a commit to bmatthews68/scalafix that referenced this issue Sep 15, 2017

@olafurpg olafurpg self-assigned this Oct 6, 2017

@olafurpg olafurpg removed this from the v0.5.4 milestone Nov 2, 2017

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Aug 27, 2018

Member

This has become significantly easier with the scalafix.v1 API. Basic idea of how this could be implemented if somebody wants to take a stab at it https://github.com/scalacenter/scalafix/blob/dcaad372cef100e76efd4d106b15f3a3ee2740c3/scalafix-tests/unit/src/main/scala/scalafix/test/ExplicitSynthetic.scala

Rules like this will live in a separate repo however so they can evolve independently from Scalafix APIs.

Member

olafurpg commented Aug 27, 2018

This has become significantly easier with the scalafix.v1 API. Basic idea of how this could be implemented if somebody wants to take a stab at it https://github.com/scalacenter/scalafix/blob/dcaad372cef100e76efd4d106b15f3a3ee2740c3/scalafix-tests/unit/src/main/scala/scalafix/test/ExplicitSynthetic.scala

Rules like this will live in a separate repo however so they can evolve independently from Scalafix APIs.

@olafurpg olafurpg closed this Aug 27, 2018

@olafurpg olafurpg added the community label Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment