diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-03 12:53:10 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-17 18:34:27 +0100 |
commit | fd2c24c3159cefa583889a176f31d1e2325fe7e6 (patch) | |
tree | 2291e9ecee03b130f50e3c3a4d9660d95bca2723 /compiler/src/dotty/tools/dotc/typer/Typer.scala | |
parent | 8450556080c5fd8f8553bec4f39ea08fbb05c9d2 (diff) | |
download | dotty-fd2c24c3159cefa583889a176f31d1e2325fe7e6.tar.gz dotty-fd2c24c3159cefa583889a176f31d1e2325fe7e6.tar.bz2 dotty-fd2c24c3159cefa583889a176f31d1e2325fe7e6.zip |
Add syntax for implicit functions
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Typer.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index eec3859f9..c8deda4bc 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -660,9 +660,13 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedFunction(tree: untpd.Function, pt: Type)(implicit ctx: Context) = track("typedFunction") { val untpd.Function(args, body) = tree - if (ctx.mode is Mode.Type) + if (ctx.mode is Mode.Type) { + val funCls = + if (tree.isInstanceOf[untpd.ImplicitFunction]) defn.ImplicitFunctionClass(args.length) + else defn.FunctionClass(args.length) typed(cpy.AppliedTypeTree(tree)( - untpd.TypeTree(defn.FunctionClass(args.length).typeRef), args :+ body), pt) + untpd.TypeTree(funCls.typeRef), args :+ body), pt) + } else { val params = args.asInstanceOf[List[untpd.ValDef]] |