-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix sequence matching. #669
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
Unintentionally fixed #656. |
Even if an explicit outer accessor was a method, it got a TermRef as type.
I believe we have some issue with partest here. I can locally reproduce partest failure on the local machine. Though I cannot reproduce it if I directly use class files that partest generated: If I go to the directory with class files compiled by partest and execute the very same command that partest did:
The test runs correctly. |
If an inner class has proxy fields, we missed so far the assignment sfrom the proxy parameters in the primary constructor of the class to the proxy fields. Test case tries several variations of this.
When I try manually it I get the same error as partest. |
They used to be discoverable using repeatedType, but ElimRepeated eliminates it. Instead I'm using internal synthetic Typed nodes name, similar to how it's done for non-star Wildcards. This makes handling Wildcards and Wildacard_Star more symmetric in patmat.
Call drop method directly if class derives from sequence. I do not understand how callRuntime works in scalac. Calling this method requires implicit search.
Was also fixed in this PR.
c26b336
to
d3819ce
Compare
@@ -136,7 +136,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans | |||
def callDirect = tgt.select(nme.drop).appliedTo(Literal(Constant(n))) | |||
def callRuntime = ref(defn.traversableDropMethod).appliedTo(tgt, Literal(Constant(n))) | |||
|
|||
def needsRuntime = tgt.tpe derivesFrom defn.SeqClass /*typeOfMemberNamedDrop(tgt.tpe) == NoType*/ | |||
def needsRuntime = !(tgt.tpe derivesFrom defn.SeqClass) /*typeOfMemberNamedDrop(tgt.tpe) == NoType*/ |
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.
Redundant parens around the expression.
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.
Sorry, I was myopic here. All's good.
Otherwise LGTM. |
@odersky please review.
Fixes #660