Skip to content

Commit 37add7a

Browse files
Backport "Don't search for implicit conversions to NoType" to LTS (#20863)
Backports #19563 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 9bdef0b + 25c30bb commit 37add7a

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)