summaryrefslogtreecommitdiff
path: root/test/files/pos/userdefined_apply.flags
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-04-12 11:31:54 -0700
committerAdriaan Moors <adriaan@lightbend.com>2017-04-12 14:02:21 -0700
commit77917e94c70759602be0dae833e798e894999254 (patch)
tree7d7cec3c558bb89db482863c3573cfe049f0affb /test/files/pos/userdefined_apply.flags
parent5167b691bbc6eccc671ef3a49c7ecaf3343c0baa (diff)
downloadscala-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/pos/userdefined_apply.flags')
-rw-r--r--test/files/pos/userdefined_apply.flags1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/files/pos/userdefined_apply.flags b/test/files/pos/userdefined_apply.flags
new file mode 100644
index 0000000000..0acce1e7ce
--- /dev/null
+++ b/test/files/pos/userdefined_apply.flags
@@ -0,0 +1 @@
+-Xsource:2.12