Skip to content
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

Fix: Remove multiple enum owner imports #4477

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

jkciesluk
Copy link
Member

Previously exhaustive match completion on enum created multiple imports of enum owner

package withenum {
enum Color(rank: Int):
  case Red extends Color(1)
  case Blue extends Color(2)
  case Green extends Color(3)
}

package example
object Main {
  val x: withenum.Color = ???
  x match@@
}

Resulted in

import withenum.Color
import withenum.Color
import withenum.Color

package withenum {
enum Color(rank: Int):
  case Red extends Color(1)
  case Blue extends Color(2)
  case Green extends Color(3)
}

package example
object Main {
  val x: withenum.Color = ???
  x match@@
}

Now, we do distinct on additional edits so duplicates will be removed

@jkciesluk jkciesluk requested a review from tgodzik October 4, 2022 07:40
@tgodzik tgodzik merged commit c341729 into scalameta:main Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants