diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-09 14:53:08 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-26 14:49:04 +0100 |
commit | 7babdab9ace07884ce844af923c93e0dcd49f7ea (patch) | |
tree | 4c02c41d5551de0104a7b055509b8e4d8979b594 /test | |
parent | cff09340327ddcfd3d39aca69dfb719e7a501b5f (diff) | |
download | scala-7babdab9ace07884ce844af923c93e0dcd49f7ea.tar.gz scala-7babdab9ace07884ce844af923c93e0dcd49f7ea.tar.bz2 scala-7babdab9ace07884ce844af923c93e0dcd49f7ea.zip |
SI-6891 Fix value class + tailrec crasher.
rhs.substituteSymbols(old, new) leaves us with:
def loop#12225(x#12226: A#15491): scala#21.this.Unit#1615 =
loop#12225(x#12226)
In which the TermSymbol x#12226 has a stale info, pointing at
the A#7274, the class type parameter, rather than A#15491,
the corresponding type parameter of the synthetic backing
method.
I've improved `TreeSymSubstituter` to substitute not
only `Tree#{tpe, symbol}`, but also `DefTree#sym.info`.
The `pos` test that triggered the new code path are
listed here: https://gist.github.com/4575687
AFAICS, no special treatment of Function, Return, or Import
is needed in TreeSymSubstutor.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t6891.flags (renamed from test/pending/pos/t6891.flags) | 0 | ||||
-rw-r--r-- | test/files/pos/t6891.scala (renamed from test/pending/pos/t6891.scala) | 7 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/pending/pos/t6891.flags b/test/files/pos/t6891.flags index fe048006aa..fe048006aa 100644 --- a/test/pending/pos/t6891.flags +++ b/test/files/pos/t6891.flags diff --git a/test/pending/pos/t6891.scala b/test/files/pos/t6891.scala index bf79c2d293..bed2d0d777 100644 --- a/test/pending/pos/t6891.scala +++ b/test/files/pos/t6891.scala @@ -9,6 +9,13 @@ object O { @annotation.tailrec def loop(x: value.type): Unit = loop(x) () } + + def beppy[C](c: => C) = { + () => c + @annotation.tailrec def loop(x: value.type): Unit = loop(x) + () => c + () + } } // uncaught exception during compilation: Types$TypeError("type mismatch; // found : A(in method bippy$extension) |