aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2016-08-25 09:57:18 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2016-09-05 13:47:51 +0200
commit390a44cdd0b3f43df0969368f62314d78a25c699 (patch)
tree0498cdbeff47946751e6ec451b9c3f6b89ede5cd /src/dotty/tools/dotc/typer/Applications.scala
parent34ef58008168d516d03599097ad1c6189d58a9c8 (diff)
downloaddotty-390a44cdd0b3f43df0969368f62314d78a25c699.tar.gz
dotty-390a44cdd0b3f43df0969368f62314d78a25c699.tar.bz2
dotty-390a44cdd0b3f43df0969368f62314d78a25c699.zip
Fix #1474: Fix applies to applyDynamic.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 318f2f8ff..52e80930e 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -592,13 +592,15 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
fun1.tpe match {
case ErrorType => tree.withType(ErrorType)
case TryDynamicCallType =>
- tree match {
- case Apply(Select(qual, name), args) if !isDynamicMethod(name) =>
- typedDynamicApply(qual, name, None, args, pt)(tree)
- case Apply(TypeApply(Select(qual, name), targs), args) if !isDynamicMethod(name) =>
- typedDynamicApply(qual, name, Some(targs), args, pt)(tree)
- case _ =>
- handleUnexpectedFunType(tree, fun1)
+ tree.fun match {
+ case Select(qual, name) if !isDynamicMethod(name) =>
+ typedDynamicApply(qual, name, None, tree.args, pt)(tree)
+ case TypeApply(Select(qual, name), targs) if !isDynamicMethod(name) =>
+ typedDynamicApply(qual, name, Some(targs), tree.args, pt)(tree)
+ case TypeApply(fun, targs) =>
+ typedDynamicApply(fun, nme.apply, Some(targs), tree.args, pt)(tree)
+ case fun =>
+ typedDynamicApply(fun, nme.apply, None, tree.args, pt)(tree)
}
case _ =>
tryEither {