aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-05 10:34:58 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-17 18:34:27 +0100
commitbcc80ad1343a3ed01bef55f494d9658cf02226c6 (patch)
tree5fb2feecdf0df524128c72d14a6402fd6c547291 /compiler/src/dotty/tools/dotc/core/Definitions.scala
parent0336785a2280a4a1e51e739e9aac3d5015f7c16f (diff)
downloaddotty-bcc80ad1343a3ed01bef55f494d9658cf02226c6.tar.gz
dotty-bcc80ad1343a3ed01bef55f494d9658cf02226c6.tar.bz2
dotty-bcc80ad1343a3ed01bef55f494d9658cf02226c6.zip
Create implicit closures to math expected implicit functions
When the expected type is an implicit function, create an implicit closure to match it.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Definitions.scala3
1 files changed, 3 insertions, 0 deletions
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 */