diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-03-23 18:37:30 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2016-04-18 14:46:57 +0200 |
commit | 7e2352ac7a5968958156c5fdab54b3e9e9f2808f (patch) | |
tree | 8fe6f927cc0c22e4a702a0ffc2de2401edd5db42 /src/dotty/tools/dotc/typer/Applications.scala | |
parent | 0211e56d104934188007e3c02eac131b81460100 (diff) | |
download | dotty-7e2352ac7a5968958156c5fdab54b3e9e9f2808f.tar.gz dotty-7e2352ac7a5968958156c5fdab54b3e9e9f2808f.tar.bz2 dotty-7e2352ac7a5968958156c5fdab54b3e9e9f2808f.zip |
Decouple handling array constructors from typer.
It's done in a separate ArrayConstructors phase now.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index ec2508580..c0664e0d6 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -560,7 +560,7 @@ trait Applications extends Compatibility { self: Typer => if (proto.argsAreTyped) new ApplyToTyped(tree, fun1, funRef, proto.typedArgs, pt) else new ApplyToUntyped(tree, fun1, funRef, proto, pt)(argCtx(tree)) val result = app.result - convertNewArray(ConstFold(result)) + ConstFold(result) } { (failedVal, failedState) => val fun2 = tryInsertImplicitOnQualifier(fun1, proto) if (fun1 eq fun2) { @@ -636,15 +636,6 @@ trait Applications extends Compatibility { self: Typer => def adaptTypeArg(tree: tpd.Tree, bound: Type)(implicit ctx: Context): tpd.Tree = tree.withType(tree.tpe.etaExpandIfHK(bound)) - /** Rewrite `new Array[T](....)` trees to calls of newXYZArray methods. */ - def convertNewArray(tree: tpd.Tree)(implicit ctx: Context): tpd.Tree = tree match { - case Apply(TypeApply(tycon, targ :: Nil), args) if tycon.symbol == defn.ArrayConstructor => - fullyDefinedType(tree.tpe, "array", tree.pos) - tpd.cpy.Apply(tree)(newArray(targ, tree.pos), args) - case _ => - tree - } - def typedUnApply(tree: untpd.Apply, selType: Type)(implicit ctx: Context): Tree = track("typedUnApply") { val Apply(qual, args) = tree |