summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-06-12 15:01:24 +0000
committermihaylov <mihaylov@epfl.ch>2006-06-12 15:01:24 +0000
commit016ff4c9ec1c2836a61060b97d056da79d00a3a9 (patch)
tree283d2f5ab23d5e05f35d3a61f3f1d7bd7700b0c4 /src/compiler
parent6e756ebf32d2a1eb5cdeee894237193c0a06f508 (diff)
downloadscala-016ff4c9ec1c2836a61060b97d056da79d00a3a9.tar.gz
scala-016ff4c9ec1c2836a61060b97d056da79d00a3a9.tar.bz2
scala-016ff4c9ec1c2836a61060b97d056da79d00a3a9.zip
Generate Nil for List()
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 6effca1c70..0fad675192 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1073,7 +1073,10 @@ trait Typers requires Analyzer {
case MethodType(_, rtp) if ((mode & PATTERNmode) != 0) => rtp
case _ => tp
}
- if ((mode & CONSTmode) != 0 && fun.symbol.owner == PredefModule.tpe.symbol && fun.symbol.name == nme.Array) {
+ if (fun.symbol == List_apply && args.isEmpty) {
+ gen.mkNil setType restpe
+ }
+ else if ((mode & CONSTmode) != 0 && fun.symbol.owner == PredefModule.tpe.symbol && fun.symbol.name == nme.Array) {
val elems = new Array[Constant](args1.length)
var i = 0;
for (val arg <- args1) arg match {