Skip to content

Compiler enters infinite loop with extension method on akka streams #23268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Krever opened this issue May 27, 2025 · 0 comments
Open

Compiler enters infinite loop with extension method on akka streams #23268

Krever opened this issue May 27, 2025 · 0 comments
Labels
itype:compiler hangs Issues where the compiler hangs. stat:needs minimization Needs a self contained minimization

Comments

@Krever
Copy link

Krever commented May 27, 2025

Sorry for the poor issue title, I didn't have time to minimize it further and remove the akka dependency.

Compiler version

3.7.0

Minimized example

//> using scala "3.7.0"
//> using dep "com.typesafe.akka::akka-stream:2.8.8"

import akka.actor.ActorSystem
import akka.stream.scaladsl._
import akka.stream.KillSwitches
import akka.NotUsed

import scala.concurrent.Future

implicit class XXXX[+Out, +Mat, ReprMat[+O, +M] <: FlowOpsMat[O, M]](val stream: ReprMat[Out, Mat]) {
  def traceStream1(): stream.ReprMat[Out, Mat] = ???
}

def a: Source[Int, NotUsed]                 = ???
def b: Sink[Int, Future[Option[Int]]] = ???
a.traceStream1()
  .viaMat(KillSwitches.single)(Keep.right)
  .alsoToMat(b)(Keep.both)
  .map(_._2)

Output

None, compiler never finishes running

Expectation

It compiles or throws an error.

@Krever Krever added the stat:needs triage Every issue needs to have an "area" and "itype" label label May 27, 2025
@Gedochao Gedochao added stat:needs minimization Needs a self contained minimization itype:compiler hangs Issues where the compiler hangs. and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:compiler hangs Issues where the compiler hangs. stat:needs minimization Needs a self contained minimization
Projects
None yet
Development

No branches or pull requests

2 participants