From 83d435640e0a2645256bc588306fdeef1d5799a2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 28 Feb 2015 13:56:22 +0100 Subject: Fix bug which prevented New over type-instantiated aliases. Previously, type Map = HashMap[Int, String] new Map did not work. See test aliasNew.scala for a test. Formerly this logic handled in Parsers (wrapNew), but that one does not work for aliastypes. --- src/dotty/tools/dotc/parsing/Parsers.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/parsing/Parsers.scala') diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index b7028430b..238c43854 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1408,12 +1408,7 @@ object Parsers { } /** Wrap annotation or constructor in New(...). */ - def wrapNew(tpt: Tree) = tpt match { - case AppliedTypeTree(tpt1, targs) => - TypeApply(Select(New(tpt1), nme.CONSTRUCTOR), targs) - case _ => - Select(New(tpt), nme.CONSTRUCTOR) - } + def wrapNew(tpt: Tree) = Select(New(tpt), nme.CONSTRUCTOR) /** Adjust start of annotation or constructor to position of preceding @ or new */ def adjustStart(start: Offset)(tree: Tree): Tree = { -- cgit v1.2.3