-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove dead code in pattern matching #2157
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First two commits, LGTM.
I'm not sure about the third one. I believe there's a value in keeping same structure that scalac had.
protected def seqTree(binder: Symbol) = tupleSel(binder)(firstIndexingBinder + 1) | ||
protected def tupleSel(binder: Symbol)(i: Int): Tree = { | ||
private def seqTree(binder: Symbol): Tree = | ||
if (firstIndexingBinder == 0) ref(binder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't a refactoring, why did you need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's overriden in the only trait instance https://github.com/lampepfl/dotty/pull/2157/files#diff-b72950e41046b80e7386c4936d560cf9L1611
def resultInMonad = | ||
if (aligner.isBool) defn.UnitType | ||
else if (isProductMatch(resultType, aligner.prodArity)) resultType | ||
else if (isGetMatch(resultType)) extractorMemberType(resultType, nme.get) | ||
else resultType | ||
|
||
def resultType: Type | ||
|
||
/** Create the TreeMaker that embodies this extractor call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to preserve documentation
5107c89
to
fe4974c
Compare
Alright, removed the 3rd commit. |
This entry point to pattern matching is apparently unreachable.
tupleExtractor
which in also unreachable in dotty.