aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala2
-rw-r--r--tests/pos/t0786.scala (renamed from tests/untried/pos/t0786.scala)6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index d0aa8d546..fe1c938c9 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -65,7 +65,7 @@ object Implicits {
case tpw =>
//if (ctx.typer.isApplicable(tp, argType :: Nil, resultType))
// println(i"??? $tp is applicable to $this / typeSymbol = ${tpw.typeSymbol}")
- true
+ !tpw.derivesFrom(defn.FunctionClass(1))
}
def discardForValueType(tpw: Type): Boolean = tpw match {
diff --git a/tests/untried/pos/t0786.scala b/tests/pos/t0786.scala
index b347b0bc5..b320de0ed 100644
--- a/tests/untried/pos/t0786.scala
+++ b/tests/pos/t0786.scala
@@ -7,15 +7,15 @@ object ImplicitProblem {
def eval: Int
}
- implicit def toRep0(n: Int): ImplicitProblem.Rep[Int] = new Rep[Int] {
+ implicit def toRep0(n: Int): Rep[Int] = new Rep[Int] {
def eval = 0
}
- implicit def toRepN[T](n: M[T])(implicit f: T => Rep[T]): ImplicitProblem.Rep[ImplicitProblem.M[T]] = new Rep[M[T]] {
+ implicit def toRepN[T](n: M[T])(implicit f: T => Rep[T]): Rep[M[T]] = new Rep[M[T]] {
def eval = f(nullval[T]).eval + 1
}
- def depth[T <% Rep[T]](n: T) = n.eval
+ def depth[T](n: T)(implicit ev: T => Rep[T]) = n.eval
def main(args: Array[String]): Unit = {
println(depth(nullval[M[Int]])) // (1) this works