From bcc80ad1343a3ed01bef55f494d9658cf02226c6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 5 Dec 2016 10:34:58 +0100 Subject: Create implicit closures to math expected implicit functions When the expected type is an implicit function, create an implicit closure to match it. --- compiler/src/dotty/tools/dotc/core/Definitions.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/src/dotty/tools/dotc/core') diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index ff259f184..814bbf48f 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -790,6 +790,9 @@ class Definitions { def functionArity(tp: Type)(implicit ctx: Context) = tp.dealias.argInfos.length - 1 + def isImplicitFunctionType(tp: Type)(implicit ctx: Context) = + isFunctionType(tp) && tp.dealias.typeSymbol.name.startsWith(tpnme.ImplicitFunction) + // ----- primitive value class machinery ------------------------------------------ /** This class would also be obviated by the implicit function type design */ -- cgit v1.2.3