diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-18 16:56:10 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-18 19:09:15 -0800 |
commit | 0894d3be180aa28f43eed557d29e7b997a78fcfc (patch) | |
tree | 3657511f26575fc39ec03f640f9d2c21ffa7c120 /src/library | |
parent | 2fe570291a41e2701f3118bc0f643a9fa60c476b (diff) | |
download | scala-0894d3be180aa28f43eed557d29e7b997a78fcfc.tar.gz scala-0894d3be180aa28f43eed557d29e7b997a78fcfc.tar.bz2 scala-0894d3be180aa28f43eed557d29e7b997a78fcfc.zip |
Cleanup in aisle New.
More trees created more uniformly.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/reflect/api/Trees.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/library/scala/reflect/api/Trees.scala b/src/library/scala/reflect/api/Trees.scala index 2c960392ec..1472866460 100644 --- a/src/library/scala/reflect/api/Trees.scala +++ b/src/library/scala/reflect/api/Trees.scala @@ -486,11 +486,10 @@ trait Trees { self: Universe => * A `New(t, as)` is expanded to: `(new t).<init>(as)` */ def New(tpt: Tree, argss: List[List[Tree]]): Tree = { - assert(!argss.isEmpty) // todo. we need to expose names in scala.reflect.api -// val superRef: Tree = Select(New(tpt), nme.CONSTRUCTOR) val superRef: Tree = Select(New(tpt), nme.CONSTRUCTOR) - (superRef /: argss) (Apply) + if (argss.isEmpty) Apply(superRef, Nil) + else (superRef /: argss) (Apply) } /** Type annotation, eliminated by explicit outer */ |