Skip to content

Commit 25c30bb

Browse files
oderskyWojciechMazur
authored andcommitted
Don't search for implicit conversions to NoType
[Cherry-picked 482a6a0]
1 parent 9c651d1 commit 25c30bb

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ trait Implicits:
10411041
if (argument.isEmpty) i"missing implicit parameter of type $pt after typer at phase ${ctx.phase.phaseName}"
10421042
else i"type error: ${argument.tpe} does not conform to $pt${err.whyNoMatchStr(argument.tpe, pt)}")
10431043

1044-
val usableForInference = !pt.unusableForInference
1044+
val usableForInference = pt.exists && !pt.unusableForInference
10451045
&& (argument.isEmpty || !argument.tpe.unusableForInference)
10461046

10471047
val result0 = if usableForInference then

tests/neg/i19320.scala

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//> using scala "3.3.1"
2+
//> using dep org.http4s::http4s-ember-client:1.0.0-M40
3+
//> using dep org.http4s::http4s-ember-server:1.0.0-M40
4+
//> using dep org.http4s::http4s-dsl:1.0.0-M40
5+
6+
//import cats.effect.*
7+
//import cats.implicits.*
8+
9+
class Concurrent[F[_]]
10+
11+
class Test[F[_]: Concurren]: // error
12+
def hello = ???
13+
14+
object Test:
15+
def apply[F[_]: Concurrent] = new Test[F]

0 commit comments

Comments
 (0)