summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-06-18 17:19:55 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-06-18 17:19:55 +0000
commit3ee6b3653f8c25d7d6b19b9f5d4af7fa082146a8 (patch)
treee97b8c0dd8d61e82f825f528f98842f777621f7a /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentbe8e3c69114da5bc3020d5363b338b1c83aa22ef (diff)
downloadscala-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.scala9
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) } }