diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-05-30 09:20:21 +0200 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-07-07 11:10:44 +0200 |
commit | 75da0358fd7866f3dccdfcf4fbeae9af8ccc69f3 (patch) | |
tree | 142087645d00858f20eaead2f805afb333d2bddc /src/dotty/tools/dotc/typer/Applications.scala | |
parent | 07fd8a357ed660ef15163efb2788928fec290fdd (diff) | |
download | dotty-75da0358fd7866f3dccdfcf4fbeae9af8ccc69f3.tar.gz dotty-75da0358fd7866f3dccdfcf4fbeae9af8ccc69f3.tar.bz2 dotty-75da0358fd7866f3dccdfcf4fbeae9af8ccc69f3.zip |
Fix #657: Add scala.Dynamic support.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index a9184c7e5..bab85f2a4 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -86,11 +86,12 @@ object Applications { import Applications._ -trait Applications extends Compatibility { self: Typer => +trait Applications extends Compatibility { self: Typer with Dynamic => import Applications._ import tpd.{ cpy => _, _ } import untpd.cpy + import Dynamic.isDynamicMethod /** @tparam Arg the type of arguments, could be tpd.Tree, untpd.Tree, or Type * @param methRef the reference to the method of the application @@ -553,6 +554,13 @@ trait Applications extends Compatibility { self: Typer => fun1.tpe match { case ErrorType => tree.withType(ErrorType) + case TryDynamicCallType => + tree match { + case tree @ Apply(Select(qual, name), args) if !isDynamicMethod(name) => + typedDynamicApply(qual, name, args, pt)(tree) + case _ => + handleUnexpectedFunType(tree, fun1) + } case _ => methPart(fun1).tpe match { case funRef: TermRef => tryEither { implicit ctx => |