diff options
author | Dmitry Petrashko <dark@d-d.me> | 2016-07-15 13:22:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-15 13:22:06 +0200 |
commit | f37e45a516ca97a27fed279c5da26574d2fe77db (patch) | |
tree | 268a2283e96ce363bf4fd9bca9d7a6be6e90ef7f /src/dotty/tools/dotc/typer/Applications.scala | |
parent | 18a1c206295fc85c795da48b3e737b88a2bb56e5 (diff) | |
parent | 7e00c724273d432c8900c0e8ec852bb77357958e (diff) | |
download | dotty-f37e45a516ca97a27fed279c5da26574d2fe77db.tar.gz dotty-f37e45a516ca97a27fed279c5da26574d2fe77db.tar.bz2 dotty-f37e45a516ca97a27fed279c5da26574d2fe77db.zip |
Merge pull request #1291 from nicolasstucki/implement-scala-dynamic
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 aba073f3d..6e78a570d 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -87,11 +87,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 @@ -554,6 +555,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 => |