Skip to content

Commit

Permalink
Don't search for implicit conversions to NoType
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jan 29, 2024
1 parent b20747d commit 482a6a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ trait Implicits:
if (argument.isEmpty) i"missing implicit parameter of type $pt after typer at phase ${ctx.phase.phaseName}"
else i"type error: ${argument.tpe} does not conform to $pt${err.whyNoMatchStr(argument.tpe, pt)}")

val usableForInference = !pt.unusableForInference
val usableForInference = pt.exists && !pt.unusableForInference
&& (argument.isEmpty || !argument.tpe.unusableForInference)

val result0 = if usableForInference then
Expand Down
15 changes: 15 additions & 0 deletions tests/neg/i19320.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//> using scala "3.3.1"
//> using dep org.http4s::http4s-ember-client:1.0.0-M40
//> using dep org.http4s::http4s-ember-server:1.0.0-M40
//> using dep org.http4s::http4s-dsl:1.0.0-M40

//import cats.effect.*
//import cats.implicits.*

class Concurrent[F[_]]

class Test[F[_]: Concurren]: // error
def hello = ???

object Test:
def apply[F[_]: Concurrent] = new Test[F]

0 comments on commit 482a6a0

Please sign in to comment.