diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-17 09:19:21 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-17 13:05:08 +0200 |
commit | 15e9ef8f083e0c0dc75bf51a0784f56df2e2bea8 (patch) | |
tree | 4ace5c078ce2931263b5de50de77377faa3da778 /push-binary-libs.sh | |
parent | 4525e9223a2fb7c1ec3014073566b559e5839805 (diff) | |
download | scala-15e9ef8f083e0c0dc75bf51a0784f56df2e2bea8.tar.gz scala-15e9ef8f083e0c0dc75bf51a0784f56df2e2bea8.tar.bz2 scala-15e9ef8f083e0c0dc75bf51a0784f56df2e2bea8.zip |
SI-7377 Fix retypechecking of patterns on case companion alias
Some ancient code in Typers switches from PATTERNmode to
EXPRmode when encountering `stableF(...)`. It just
typechecks `stableF` and discards the arguments.
To the best of Martin's recollection, this has something
to do with the need to typecheck patterns rather late in
the compiler, after `a.b` had been translated to `a.b()`
in `Uncurry`. I'm not able to motivate this with tests
using `-Xoldpatmat`; was there ever an even older pattern
matcher that ran *after* uncurry?
What changed in 2.10.1 to expose this wrinkle? dfbaaa17
fixed `TypeTree.copyAttrs` to copy the original tree.
During the descent of `ResetAttrs`, sub-trees are duplicated
before begin further transformed. Duplicating the `Match`
in 2.10.0 would forget that the original tree of:
pat = (a: Int)Foo(_)
`----------`
`- TypeTree((a: Int)Foo), with original Select(..., "FooAlias")
The retypechecking would operate on the `MethodType`, rather
than the `Select`, which was not considered a stable
application.
For 2.10.x, I've just tightened up the condition to only
hit this if `args` is empty. I'm almost certain that the code
can be removed altogether, and I'll do that when this is merged
to master.
Diffstat (limited to 'push-binary-libs.sh')
0 files changed, 0 insertions, 0 deletions