Skip to content

Compiler crashes on simple code. #23054

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
jrlemieux opened this issue Apr 26, 2025 · 2 comments
Open

Compiler crashes on simple code. #23054

jrlemieux opened this issue Apr 26, 2025 · 2 comments

Comments

@jrlemieux
Copy link

jrlemieux commented Apr 26, 2025

Compiler version

3.6.4

Minimized code

object Bug:

  def m0(f: PartialFunction[Char, Unit]): Unit = ()

  def m1(): Unit =
    m0: x =>
      "abc".filter(_ == x) match
        case _ => ()

Output (click arrow to expand)

See bug.log (or the more readable bug-nocolor.log) in attached zip file.

files.zip

@jrlemieux jrlemieux added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 26, 2025
@jrlemieux
Copy link
Author

jrlemieux commented Apr 26, 2025

Compiles without crash if m0 delcared as

  def m0(f: Char => Unit): Unit = ()

Also compiles without crash with this variation (m0 receives a function rather than a partial function, but there is no "match"):

  def m0(f: PartialFunction[Char, Unit]): Unit = ()

  def m1(): Unit =
    m0: x =>
      "abc".filter(_ == x)

And this variation also works (m0 receives a partial function):

  def m0(f: PartialFunction[Char, Unit]): Unit = ()

  def m1(): Unit =
    m0:
      case x =>
        "abc".filter(_ == x) match
          case _ => ()

@som-snytt
Copy link
Contributor

Relatedly #23002 does not help.

@Gedochao Gedochao added area:lambda-lift and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants