Skip to content

Print Lists consistently in exhaustivity warnings #3003

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

Merged
merged 1 commit into from
Aug 21, 2017
Merged

Print Lists consistently in exhaustivity warnings #3003

merged 1 commit into from
Aug 21, 2017

Conversation

abgruszecki
Copy link
Contributor

@abgruszecki abgruszecki commented Aug 21, 2017

First off - I wasn't too sure if I should open an issue for this, since it's so trivial. I apologise if I should.

This PR adjusts how Lists are printed in error messages. Previously, depending on the specific pattern match in question, an unmatched :: would print differently depending on whether we ended up with a Typ space or Kon space. For the simplest example, Typ(::) was printed as List(_), but Kon(::, Int, List[Int]) was printed as List(_, _*). The error messages were also slightly confusing, since to me List(_) suggests that the list has only one member, whereas a :: can have one-or-more members. After adjustments, List now prints consistently as though we had ended up with the Kon space. Note that the code is equivalent to showing Kon(tp, signature(tp).map(Typ(_, false))).

/cc @liufengyun

@smarter smarter requested a review from liufengyun August 21, 2017 16:39
@smarter
Copy link
Member

smarter commented Aug 21, 2017

First off - I wasn't too sure if I should open an issue for this, since it's so trivial. I apologise if I should.

It's fine to open PRs without corresponding issues :).

@abgruszecki abgruszecki changed the title Print Lists consistently in exhaustivity warnings Print Lists consistently in exhaustivity warnings Aug 21, 2017
@liufengyun
Copy link
Contributor

Thanks @AleksanderBG , LGTM!

@liufengyun liufengyun merged commit 9ee1734 into scala:master Aug 21, 2017
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.

3 participants