-
Notifications
You must be signed in to change notification settings - Fork 21
extractors broken: "not enough arguments for method body%1" #3136
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
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3136?orig=1 |
@paulp said: So if you want to make extractors "our problem" that would provide me with some new enthusiasm, but I can't do it right now when there is so much else that only I can (or will) do. |
@adriaanm said: |
@adriaanm said: one revelation was triggered by overriding this leads me to believe applyRule() in Rep is broken (btw, mixture has been factored out to death, I'd say, bigger methods aren't always worse) anyway, maybe we need some logic to deal with the case that an unapply label is going to be referenced before its time has come then again, I've been moodswinging between this explanation and the observation that subpatterns cause suggestions for future cleaner-upper of this code: get rid of those bloody integer indices -- objects have identity too, you know.... |
@adriaanm said: |
@paulp said:
Oh yes. I will sometimes be protective of my code, but absolutely not in the pattern matcher. So much of it is the process of trying out many different often insensible things trying to untangle the machinery. There's still plenty I know is wrong, and the names of things in some cases are for sure wrong, which is frustrating, but as they were often in the past named things like "temp" and I'm only trying to eke them along. I will take a look at the areas you mentioned: it is a huge help to have any kind of "this is wrong" lifeline to grab onto.
Yeah, don't I know it. I tried to do that at some point and it was one of many times I discovered that they were doing something beyond what I understood they were doing. Note the use of negative indices... there was something bizarre about it. I thought I'd duplicated it but things broke. |
@paulp said:
You need to read my email where I explained the origin of #1697 and #2337 if you haven't already. http://article.gmane.org/gmane.comp.lang.scala.internals/2752 The problem is in MixTypes, because the unapply gets broken up into two tests which end up separating and breaking the logic. It should be: if (x && y) body1 else body2 However MixTypes has completely foiled my attempts to deconstruct it far enough to accomplish this. The entirety of Patterns.scala and all code which uses it is essentially my attempt at rewriting the whole thing to keep such tests together. By the way Patterns.scala should be a lot closer to code we want to use than the rest of it, but it still has many things I'm not proud because to use it I had to integrate with the rest of it. |
@paulp said:
Also: for more on this, see http://github.com/paulp/scala/tree/bug1697 That contains the distillation of the case I am aware of where it generates incorrect conditional logic. It'll yell at you if it sees it. |
@paulp said:
I had no idea you were such a fountain of homespun wisdom. OK, this is fixed and guarded with your test in r21081. I know other open tickets were caused by the same change. This sent SI-1697's test case back into pending. Now that I assume your immediate issue is gone, the temptation will be to forget all about the pattern matcher and its many victims. Although I would completely understand, that understanding wouldn't stop me from hunting you down and throwing you to the gators. |
@acruise said: |
@acruise said: Leaving -Ypmat-debug out of the picture, this line crashes due to this (or similar) bug:
When any of x, y or z are there, it crashes. But this doesn't:
And finally, this version avoids the extractor and therefore can't possibly fail:
|
Related to #2883, which was fixed by avoiding the use of extractors. Now I really need them in refactoring some stuff in the compiler, though...
The text was updated successfully, but these errors were encountered: