diff options
author | mihaylov <mihaylov@epfl.ch> | 2007-04-27 15:39:45 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2007-04-27 15:39:45 +0000 |
commit | a08e8f2d88fbbeb334312abc57e5f7cdfcb79170 (patch) | |
tree | 741be19a93ff3a6f6f3dd741aa3eb0610ccdedf6 | |
parent | a7f0266287a5479233daed27df43ad2093a6f299 (diff) | |
download | scala-a08e8f2d88fbbeb334312abc57e5f7cdfcb79170.tar.gz scala-a08e8f2d88fbbeb334312abc57e5f7cdfcb79170.tar.bz2 scala-a08e8f2d88fbbeb334312abc57e5f7cdfcb79170.zip |
Turn array of constants into an array constant;...
Turn array of constants into an array constant; fixes a bug in
annotation applications with array elements
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 9261b90544..89c5c6e4c5 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -90,6 +90,7 @@ trait Definitions { var ListModule: Symbol = _ def List_apply = getMember(ListModule, nme.apply) var ArrayClass: Symbol = _ + var ArrayModule: Symbol = _ var SerializableClass: Symbol = _ var PredefModule: Symbol = _ def Predef_classOf = getMember(PredefModule, nme.classOf) @@ -778,6 +779,7 @@ trait Definitions { ListClass = getClass("scala.List") ListModule = getModule("scala.List") ArrayClass = getClass("scala.Array") + ArrayModule = getModule("scala.Array") SerializableClass = if (forMSIL || forCLDC) null else getClass("java.io.Serializable") PredefModule = getModule("scala.Predef") ConsoleModule = getModule("scala.Console") diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index e310da959f..980a0c51c3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1533,7 +1533,9 @@ trait Typers requires Analyzer { if (fun.symbol == List_apply && args.isEmpty) { atPos(tree.pos) { gen.mkNil setType restpe } - } else if ((mode & CONSTmode) != 0 && fun.symbol.owner == PredefModule.tpe.symbol && fun.symbol.name == nme.Array) { + } else if ((mode & CONSTmode) != 0 && + fun.symbol.owner == definitions.ArrayModule.tpe.symbol && + fun.symbol.name == nme.apply) { val elems = new Array[Constant](args2.length) var i = 0; for (val arg <- args2) arg match { |