diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-17 18:25:53 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-17 18:25:53 +0100 |
commit | b7b210db14a2d59730603cc7cbf41c55275a4520 (patch) | |
tree | 56745c0fcfb70878e07faa87bf687e80980f86d0 /test/files/pos | |
parent | a5b0fc49e517d1c63d22f9909ac9bed0552ed466 (diff) | |
download | scala-b7b210db14a2d59730603cc7cbf41c55275a4520.tar.gz scala-b7b210db14a2d59730603cc7cbf41c55275a4520.tar.bz2 scala-b7b210db14a2d59730603cc7cbf41c55275a4520.zip |
Avoid cycles in Symbol toString under -Ydebug
This is the first of two commits to restore workingness
to the compiler under `-Ydebug`.
`ResetAttrs` is now called during case class unapply synthesis,
after the UnTyper was recently banished.
But, this class has some low-level tracing that is triggered
under `-Ydebug` (irrespective of any `-Ylog` settings.)
This tracing code calls `Symbol#toString`, which, in an attempt
to discriminate primary from secondary constructors, accesses
the info of its owner. This is sufficient to hit a dreaded
`CyclicReferenceError`.
The enclosed test compiles a case class under this option
to show that things now compile. It still spews out unwanted
output; this will be removed in the next commit.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/debug-reset-local-attrs.flags | 1 | ||||
-rw-r--r-- | test/files/pos/debug-reset-local-attrs.scala | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/test/files/pos/debug-reset-local-attrs.flags b/test/files/pos/debug-reset-local-attrs.flags new file mode 100644 index 0000000000..9c7d6400fc --- /dev/null +++ b/test/files/pos/debug-reset-local-attrs.flags @@ -0,0 +1 @@ +-Ydebug diff --git a/test/files/pos/debug-reset-local-attrs.scala b/test/files/pos/debug-reset-local-attrs.scala new file mode 100644 index 0000000000..8348657965 --- /dev/null +++ b/test/files/pos/debug-reset-local-attrs.scala @@ -0,0 +1 @@ +case class FT(f : Float) |