diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-06-18 17:19:55 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-06-18 17:19:55 +0000 |
commit | 3ee6b3653f8c25d7d6b19b9f5d4af7fa082146a8 (patch) | |
tree | e97b8c0dd8d61e82f825f528f98842f777621f7a /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | be8e3c69114da5bc3020d5363b338b1c83aa22ef (diff) | |
download | scala-3ee6b3653f8c25d7d6b19b9f5d4af7fa082146a8.tar.gz scala-3ee6b3653f8c25d7d6b19b9f5d4af7fa082146a8.tar.bz2 scala-3ee6b3653f8c25d7d6b19b9f5d4af7fa082146a8.zip |
Specialization landed in trunk.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 159062dca0..e324e5793f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3046,8 +3046,13 @@ trait Typers { self: Analyzer => res.tpe = res.tpe.notNull } */ - if (fun2.symbol == Array_apply) typed { atPos(tree.pos) { gen.mkCheckInit(res) } } - else res + if (fun2.symbol == Array_apply) { + val checked = gen.mkCheckInit(res) + // this check is needed to avoid infinite recursion in Duplicators + // (calling typed1 more than once for the same tree + if (checked ne res) typed { atPos(tree.pos)(checked) } + else res + } else res /* Would like to do the following instead, but curiously this fails; todo: investigate if (fun2.symbol.name == nme.apply && fun2.symbol.owner == ArrayClass) typed { atPos(tree.pos) { gen.mkCheckInit(res) } } |