Skip to content

Commit fbe06c0

Browse files
authored
Don't search for implicit conversions to NoType (#19563)
There's a good chance this will fix #19320. My problem is that without a lot of added boilerplate I cannot test it, since it's hard to have at the same time external dependencies and ad-hoc instrumentation in the compiler. But what I could observe from the minimized example, it searches for a conversion of `Concurrent[F[_]]` to `NoType` and that must have caused the blowup. In any case, the change makes obvious sense, so let's add that and see whether it improves things.
2 parents b20747d + 482a6a0 commit fbe06c0

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
@@ -1074,7 +1074,7 @@ trait Implicits:
10741074
if (argument.isEmpty) i"missing implicit parameter of type $pt after typer at phase ${ctx.phase.phaseName}"
10751075
else i"type error: ${argument.tpe} does not conform to $pt${err.whyNoMatchStr(argument.tpe, pt)}")
10761076

1077-
val usableForInference = !pt.unusableForInference
1077+
val usableForInference = pt.exists && !pt.unusableForInference
10781078
&& (argument.isEmpty || !argument.tpe.unusableForInference)
10791079

10801080
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)