From 0534bcaf69430d28adf0ac9d9f7ce8ef6e5ce429 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 28 Sep 2010 20:20:21 +0000 Subject: partial revert of r23128 ("see #3859. no review --- src/compiler/scala/tools/nsc/symtab/Definitions.scala | 2 -- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 34cc26ee99..4b5632f7d8 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -225,8 +225,6 @@ trait Definitions extends reflect.generic.StandardDefinitions { lazy val Array_clone = getMember(ArrayClass, nme.clone_) lazy val ArrayModule = getModule("scala.Array") - def isArray_Apply(sym: Symbol): Boolean = sym.owner == ArrayModule.moduleClass && sym.name == nme.apply - // reflection / structural types lazy val SoftReferenceClass = getClass("java.lang.ref.SoftReference") lazy val WeakReferenceClass = getClass("java.lang.ref.WeakReference") diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 49e3505946..742f792e84 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2679,7 +2679,7 @@ trait Typers { self: Analyzer => // and Array.apply(x: Int, xs: Int*): Array[Int] (and similar) case Apply(fun, args) => val typedFun = typed(fun, funMode(mode), WildcardType) - if (isArray_Apply(typedFun.symbol)) + if (typedFun.symbol.owner == ArrayModule.moduleClass && typedFun.symbol.name == nme.apply) pt match { case TypeRef(_, ArrayClass, targ :: _) => trees2ConstArg(args, targ) @@ -3404,7 +3404,7 @@ trait Typers { self: Analyzer => res.tpe = res.tpe.notNull } */ - if (isArray_Apply(fun2.symbol)) { + 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) -- cgit v1.2.3