diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2017-04-12 11:31:54 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan@lightbend.com> | 2017-04-12 14:02:21 -0700 |
commit | 77917e94c70759602be0dae833e798e894999254 (patch) | |
tree | 7d7cec3c558bb89db482863c3573cfe049f0affb /test/files/run/t3452e | |
parent | 5167b691bbc6eccc671ef3a49c7ecaf3343c0baa (diff) | |
download | scala-77917e94c70759602be0dae833e798e894999254.tar.gz scala-77917e94c70759602be0dae833e798e894999254.tar.bz2 scala-77917e94c70759602be0dae833e798e894999254.zip |
Actually retract clashing synthetic apply/unapply [backport]
Also make this whole retraction of apply/unapply in case of a
clashing user-defined member conditional on `-Xsource:2.12`.
It turns out, as explained by lrytz, that the retraction mechanism
was fragile because it relied on the order in which completers are run.
We now cover both the case that:
- the completer was run, the `IS_ERROR` flag was set, and the
symbol was unlinked from its scope before `addSynthetics`
in `typedStat` iterates over the scope (since the symbol is
already unlinked, the tree is not added, irrespective of its flags).
For this case, we also remove the symbol from the synthetics in
its unit (for cleanliness).
- the completer is triggered during the iteration in `addSynthetics`,
which needs the check for the `IS_ERROR` flag during the iteration.
Before, the completer just unlinked the symbol and set the IS_ERROR flag,
and I assumed the typer dropped a synthetic tree with a symbol with
that flag, because the tree was not shown in -Xprint output.
In reality, the completer just always happened to run before the
addSynthetics loop and unlinked the symbol from its scope in the
test cases I came up with (including the 2.11 community build).
Thankfully, the 2.12 community build caught my mistake, and lrytz provided
a good analysis and review.
Fix scala/bug#10261
Diffstat (limited to 'test/files/run/t3452e')
0 files changed, 0 insertions, 0 deletions