Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Apr 5, 2017

This PR adds exhaustivity checking for enum values on top of #1958. The first new commit is b34a95a. It adds child annotations for sealed enum classes that refer to their enum values. What's new is that the symbols referenced by such annotations can be term symbols. Currently the exhaustivity checking does not deal with term symbols, so some tests fail.

@liufengyun Can you take this PR over and adapt exhaustivity checking?

@liufengyun
Copy link
Contributor

Thanks @odersky , I'll take over and make it work.


private def transformMemberDef(tree: MemberDef)(implicit ctx: Context): Unit = {
val sym = tree.symbol
if (sym.is(CaseVal, butNot = Module | Method)) registerChild(sym, sym.info)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice we have this flag, it simplifies a lot of things 👍

odersky and others added 2 commits April 6, 2017 15:38
A new kind of child annotation that points to the term symbol representing an
enum value.
@liufengyun liufengyun force-pushed the add-enum-exhaustiveness branch from a6ee3d7 to 0c4a06f Compare April 6, 2017 13:38
@liufengyun liufengyun changed the title [WIP] Add enum exhaustivity checking Add enum exhaustivity checking Apr 6, 2017
@odersky
Copy link
Contributor Author

odersky commented Apr 10, 2017

Very nice simplifications! LGTM

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