Skip to content

Compiler crash when chaining two matches #23310

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
m50d opened this issue Jun 3, 2025 · 0 comments
Open

Compiler crash when chaining two matches #23310

m50d opened this issue Jun 3, 2025 · 0 comments

Comments

@m50d
Copy link

m50d commented Jun 3, 2025

Compiler version

3.3.5 and 3.3.6

Minimized code

object Example {
    val pf: PartialFunction[Unit, Unit] = s => (s match {
      case a => a
    }) match {
      case a => ()
    }
}

Output (click arrow to expand)

java.util.NoSuchElementException: key not found: method $anonfun while traversing x4
java.util.NoSuchElementException: key not found: method $anonfun while traversing case val a: scala.runtime.BoxedUnit = x4
java.util.NoSuchElementException: key not found: method $anonfun while traversing {
  case val x4: scala.runtime.BoxedUnit = x
  case val a: scala.runtime.BoxedUnit = x4
  return[matchResult2]
    {
      ()
    }
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing matchResult2[Unit]: 
  {
    case val x4: scala.runtime.BoxedUnit = x
    case val a: scala.runtime.BoxedUnit = x4
    return[matchResult2]
      {
        ()
      }
  }
java.util.NoSuchElementException: key not found: method $anonfun while traversing {
  matchResult2[Unit]: 
    {
      case val x4: scala.runtime.BoxedUnit = x
      case val a: scala.runtime.BoxedUnit = x4
      return[matchResult2]
        {
          ()
        }
    }
  scala.runtime.BoxedUnit.UNIT
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing case val x5: scala.runtime.BoxedUnit =
  {
    matchResult2[Unit]: 
      {
        case val x4: scala.runtime.BoxedUnit = x
        case val a: scala.runtime.BoxedUnit = x4
        return[matchResult2]
          {
            ()
          }
      }
    scala.runtime.BoxedUnit.UNIT
  }
java.util.NoSuchElementException: key not found: method $anonfun while traversing {
  case val x5: scala.runtime.BoxedUnit =
    {
      matchResult2[Unit]: 
        {
          case val x4: scala.runtime.BoxedUnit = x
          case val a: scala.runtime.BoxedUnit = x4
          return[matchResult2]
            {
              ()
            }
        }
      scala.runtime.BoxedUnit.UNIT
    }
  case val a: scala.runtime.BoxedUnit = x5
  return[matchResult3] true
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing matchResult3[Boolean]: 
  {
    case val x5: scala.runtime.BoxedUnit =
      {
        matchResult2[Unit]: 
          {
            case val x4: scala.runtime.BoxedUnit = x
            case val a: scala.runtime.BoxedUnit = x4
            return[matchResult2]
              {
                ()
              }
          }
        scala.runtime.BoxedUnit.UNIT
      }
    case val a: scala.runtime.BoxedUnit = x5
    return[matchResult3] true
  }
java.util.NoSuchElementException: key not found: method $anonfun while traversing override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
  matchResult3[Boolean]: 
    {
      case val x5: scala.runtime.BoxedUnit =
        {
          matchResult2[Unit]: 
            {
              case val x4: scala.runtime.BoxedUnit = x
              case val a: scala.runtime.BoxedUnit = x4
              return[matchResult2]
                {
                  ()
                }
            }
          scala.runtime.BoxedUnit.UNIT
        }
      case val a: scala.runtime.BoxedUnit = x5
      return[matchResult3] true
    }
java.util.NoSuchElementException: key not found: method $anonfun while traversing  extends scala.runtime.AbstractPartialFunction, java.io.Serializable {
  def <init>(): Unit =
    {
      super()
      ()
    }
  override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
    matchResult3[Boolean]: 
      {
        case val x5: scala.runtime.BoxedUnit =
          {
            matchResult2[Unit]: 
              {
                case val x4: scala.runtime.BoxedUnit = x
                case val a: scala.runtime.BoxedUnit = x4
                return[matchResult2]
                  {
                    ()
                  }
              }
            scala.runtime.BoxedUnit.UNIT
          }
        case val a: scala.runtime.BoxedUnit = x5
        return[matchResult3] true
      }
  override final def applyOrElse(x: scala.runtime.BoxedUnit, default: Function1)
    : Object =
    {
      matchResult5[Unit]: 
        {
          case val x7: scala.runtime.BoxedUnit =
            {
              matchResult4[Unit]: 
                {
                  case val x6: scala.runtime.BoxedUnit = x
                  case val a: scala.runtime.BoxedUnit = x6
                  return[matchResult4]
                    {
                      ()
                    }
                }
              scala.runtime.BoxedUnit.UNIT
            }
          case val a: scala.runtime.BoxedUnit = x7
          return[matchResult5]
            {
              ()
            }
        }
      scala.runtime.BoxedUnit.UNIT
    }
  override final def isDefinedAt(x: Object): Boolean =
    this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
  override final def applyOrElse(x: Object, default: Function1): Object =
    this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing final class $anon extends scala.runtime.AbstractPartialFunction, 
  java.io.Serializable {
  def <init>(): Unit =
    {
      super()
      ()
    }
  override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
    matchResult3[Boolean]: 
      {
        case val x5: scala.runtime.BoxedUnit =
          {
            matchResult2[Unit]: 
              {
                case val x4: scala.runtime.BoxedUnit = x
                case val a: scala.runtime.BoxedUnit = x4
                return[matchResult2]
                  {
                    ()
                  }
              }
            scala.runtime.BoxedUnit.UNIT
          }
        case val a: scala.runtime.BoxedUnit = x5
        return[matchResult3] true
      }
  override final def applyOrElse(x: scala.runtime.BoxedUnit, default: Function1)
    : Object =
    {
      matchResult5[Unit]: 
        {
          case val x7: scala.runtime.BoxedUnit =
            {
              matchResult4[Unit]: 
                {
                  case val x6: scala.runtime.BoxedUnit = x
                  case val a: scala.runtime.BoxedUnit = x6
                  return[matchResult4]
                    {
                      ()
                    }
                }
              scala.runtime.BoxedUnit.UNIT
            }
          case val a: scala.runtime.BoxedUnit = x7
          return[matchResult5]
            {
              ()
            }
        }
      scala.runtime.BoxedUnit.UNIT
    }
  override final def isDefinedAt(x: Object): Boolean =
    this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
  override final def applyOrElse(x: Object, default: Function1): Object =
    this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing {
  final class $anon extends scala.runtime.AbstractPartialFunction, 
    java.io.Serializable {
    def <init>(): Unit =
      {
        super()
        ()
      }
    override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
      matchResult3[Boolean]: 
        {
          case val x5: scala.runtime.BoxedUnit =
            {
              matchResult2[Unit]: 
                {
                  case val x4: scala.runtime.BoxedUnit = x
                  case val a: scala.runtime.BoxedUnit = x4
                  return[matchResult2]
                    {
                      ()
                    }
                }
              scala.runtime.BoxedUnit.UNIT
            }
          case val a: scala.runtime.BoxedUnit = x5
          return[matchResult3] true
        }
    override final def applyOrElse(x: scala.runtime.BoxedUnit,
      default: Function1): Object =
      {
        matchResult5[Unit]: 
          {
            case val x7: scala.runtime.BoxedUnit =
              {
                matchResult4[Unit]: 
                  {
                    case val x6: scala.runtime.BoxedUnit = x
                    case val a: scala.runtime.BoxedUnit = x6
                    return[matchResult4]
                      {
                        ()
                      }
                  }
                scala.runtime.BoxedUnit.UNIT
              }
            case val a: scala.runtime.BoxedUnit = x7
            return[matchResult5]
              {
                ()
              }
          }
        scala.runtime.BoxedUnit.UNIT
      }
    override final def isDefinedAt(x: Object): Boolean =
      this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
    override final def applyOrElse(x: Object, default: Function1): Object =
      this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
  }
  new scala.runtime.AbstractPartialFunction with java.io.Serializable {...}():
    scala.runtime.AbstractPartialFunction
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing Playground.Example.pf =
  {
    final class $anon extends scala.runtime.AbstractPartialFunction, 
      java.io.Serializable {
      def <init>(): Unit =
        {
          super()
          ()
        }
      override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
        matchResult3[Boolean]: 
          {
            case val x5: scala.runtime.BoxedUnit =
              {
                matchResult2[Unit]: 
                  {
                    case val x4: scala.runtime.BoxedUnit = x
                    case val a: scala.runtime.BoxedUnit = x4
                    return[matchResult2]
                      {
                        ()
                      }
                  }
                scala.runtime.BoxedUnit.UNIT
              }
            case val a: scala.runtime.BoxedUnit = x5
            return[matchResult3] true
          }
      override final def applyOrElse(x: scala.runtime.BoxedUnit,
        default: Function1): Object =
        {
          matchResult5[Unit]: 
            {
              case val x7: scala.runtime.BoxedUnit =
                {
                  matchResult4[Unit]: 
                    {
                      case val x6: scala.runtime.BoxedUnit = x
                      case val a: scala.runtime.BoxedUnit = x6
                      return[matchResult4]
                        {
                          ()
                        }
                    }
                  scala.runtime.BoxedUnit.UNIT
                }
              case val a: scala.runtime.BoxedUnit = x7
              return[matchResult5]
                {
                  ()
                }
            }
          scala.runtime.BoxedUnit.UNIT
        }
      override final def isDefinedAt(x: Object): Boolean =
        this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
      override final def applyOrElse(x: Object, default: Function1): Object =
        this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
    }
    new scala.runtime.AbstractPartialFunction with java.io.Serializable {...}():
      scala.runtime.AbstractPartialFunction
  }
java.util.NoSuchElementException: key not found: method $anonfun while traversing {
  super()
  Playground.Example.pf =
    {
      final class $anon extends scala.runtime.AbstractPartialFunction, 
        java.io.Serializable {
        def <init>(): Unit =
          {
            super()
            ()
          }
        override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
          matchResult3[Boolean]: 
            {
              case val x5: scala.runtime.BoxedUnit =
                {
                  matchResult2[Unit]: 
                    {
                      case val x4: scala.runtime.BoxedUnit = x
                      case val a: scala.runtime.BoxedUnit = x4
                      return[matchResult2]
                        {
                          ()
                        }
                    }
                  scala.runtime.BoxedUnit.UNIT
                }
              case val a: scala.runtime.BoxedUnit = x5
              return[matchResult3] true
            }
        override final def applyOrElse(x: scala.runtime.BoxedUnit,
          default: Function1): Object =
          {
            matchResult5[Unit]: 
              {
                case val x7: scala.runtime.BoxedUnit =
                  {
                    matchResult4[Unit]: 
                      {
                        case val x6: scala.runtime.BoxedUnit = x
                        case val a: scala.runtime.BoxedUnit = x6
                        return[matchResult4]
                          {
                            ()
                          }
                      }
                    scala.runtime.BoxedUnit.UNIT
                  }
                case val a: scala.runtime.BoxedUnit = x7
                return[matchResult5]
                  {
                    ()
                  }
              }
            scala.runtime.BoxedUnit.UNIT
          }
        override final def isDefinedAt(x: Object): Boolean =
          this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
        override final def applyOrElse(x: Object, default: Function1): Object =
          this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
      }
      new scala.runtime.AbstractPartialFunction with java.io.Serializable {...}(
        ):scala.runtime.AbstractPartialFunction
    }
  ()
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing def <init>(): Unit =
  {
    super()
    Playground.Example.pf =
      {
        final class $anon extends scala.runtime.AbstractPartialFunction, 
          java.io.Serializable {
          def <init>(): Unit =
            {
              super()
              ()
            }
          override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean =
            matchResult3[Boolean]: 
              {
                case val x5: scala.runtime.BoxedUnit =
                  {
                    matchResult2[Unit]: 
                      {
                        case val x4: scala.runtime.BoxedUnit = x
                        case val a: scala.runtime.BoxedUnit = x4
                        return[matchResult2]
                          {
                            ()
                          }
                      }
                    scala.runtime.BoxedUnit.UNIT
                  }
                case val a: scala.runtime.BoxedUnit = x5
                return[matchResult3] true
              }
          override final def applyOrElse(x: scala.runtime.BoxedUnit,
            default: Function1): Object =
            {
              matchResult5[Unit]: 
                {
                  case val x7: scala.runtime.BoxedUnit =
                    {
                      matchResult4[Unit]: 
                        {
                          case val x6: scala.runtime.BoxedUnit = x
                          case val a: scala.runtime.BoxedUnit = x6
                          return[matchResult4]
                            {
                              ()
                            }
                        }
                      scala.runtime.BoxedUnit.UNIT
                    }
                  case val a: scala.runtime.BoxedUnit = x7
                  return[matchResult5]
                    {
                      ()
                    }
                }
              scala.runtime.BoxedUnit.UNIT
            }
          override final def isDefinedAt(x: Object): Boolean =
            this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
          override final def applyOrElse(x: Object, default: Function1): Object
             =
            this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
        }
        new 
          scala.runtime.AbstractPartialFunction with java.io.Serializable {...}(
          ):scala.runtime.AbstractPartialFunction
      }
    ()
  }
java.util.NoSuchElementException: key not found: method $anonfun while traversing  extends Object {
  def <init>(): Unit =
    {
      super()
      Playground.Example.pf =
        {
          final class $anon extends scala.runtime.AbstractPartialFunction, 
            java.io.Serializable {
            def <init>(): Unit =
              {
                super()
                ()
              }
            override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean
               =
              matchResult3[Boolean]: 
                {
                  case val x5: scala.runtime.BoxedUnit =
                    {
                      matchResult2[Unit]: 
                        {
                          case val x4: scala.runtime.BoxedUnit = x
                          case val a: scala.runtime.BoxedUnit = x4
                          return[matchResult2]
                            {
                              ()
                            }
                        }
                      scala.runtime.BoxedUnit.UNIT
                    }
                  case val a: scala.runtime.BoxedUnit = x5
                  return[matchResult3] true
                }
            override final def applyOrElse(x: scala.runtime.BoxedUnit,
              default: Function1): Object =
              {
                matchResult5[Unit]: 
                  {
                    case val x7: scala.runtime.BoxedUnit =
                      {
                        matchResult4[Unit]: 
                          {
                            case val x6: scala.runtime.BoxedUnit = x
                            case val a: scala.runtime.BoxedUnit = x6
                            return[matchResult4]
                              {
                                ()
                              }
                          }
                        scala.runtime.BoxedUnit.UNIT
                      }
                    case val a: scala.runtime.BoxedUnit = x7
                    return[matchResult5]
                      {
                        ()
                      }
                  }
                scala.runtime.BoxedUnit.UNIT
              }
            override final def isDefinedAt(x: Object): Boolean =
              this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
            override final def applyOrElse(x: Object, default: Function1):
              Object =
              this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
            }
          new 
            scala.runtime.AbstractPartialFunction with java.io.Serializable
              {...}
          ():scala.runtime.AbstractPartialFunction
        }
      ()
    }
  private def writeReplace(): Object =
    new scala.runtime.ModuleSerializationProxy(classOf[Playground.Example])
  private val pf: PartialFunction
  def pf(): PartialFunction = Playground.Example.pf
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing final module class Example extends Object {
  def <init>(): Unit =
    {
      super()
      Playground.Example.pf =
        {
          final class $anon extends scala.runtime.AbstractPartialFunction, 
            java.io.Serializable {
            def <init>(): Unit =
              {
                super()
                ()
              }
            override final def isDefinedAt(x: scala.runtime.BoxedUnit): Boolean
               =
              matchResult3[Boolean]: 
                {
                  case val x5: scala.runtime.BoxedUnit =
                    {
                      matchResult2[Unit]: 
                        {
                          case val x4: scala.runtime.BoxedUnit = x
                          case val a: scala.runtime.BoxedUnit = x4
                          return[matchResult2]
                            {
                              ()
                            }
                        }
                      scala.runtime.BoxedUnit.UNIT
                    }
                  case val a: scala.runtime.BoxedUnit = x5
                  return[matchResult3] true
                }
            override final def applyOrElse(x: scala.runtime.BoxedUnit,
              default: Function1): Object =
              {
                matchResult5[Unit]: 
                  {
                    case val x7: scala.runtime.BoxedUnit =
                      {
                        matchResult4[Unit]: 
                          {
                            case val x6: scala.runtime.BoxedUnit = x
                            case val a: scala.runtime.BoxedUnit = x6
                            return[matchResult4]
                              {
                                ()
                              }
                          }
                        scala.runtime.BoxedUnit.UNIT
                      }
                    case val a: scala.runtime.BoxedUnit = x7
                    return[matchResult5]
                      {
                        ()
                      }
                  }
                scala.runtime.BoxedUnit.UNIT
              }
            override final def isDefinedAt(x: Object): Boolean =
              this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
            override final def applyOrElse(x: Object, default: Function1):
              Object =
              this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit], default)
            }
          new 
            scala.runtime.AbstractPartialFunction with java.io.Serializable
              {...}
          ():scala.runtime.AbstractPartialFunction
        }
      ()
    }
  private def writeReplace(): Object =
    new scala.runtime.ModuleSerializationProxy(classOf[Playground.Example])
  private val pf: PartialFunction
  def pf(): PartialFunction = Playground.Example.pf
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing  extends Object, com.olegych.scastie.api.runtime.package.ScastieApp {
  def <init>(): Unit =
    {
      super()
      super[App].<init>()
      Playground.instrumentationMap =
        _root_.scala.collection.mutable.Map.empty().asInstanceOf[
          scala.collection.mutable.Map]
      scala.runtime.Statics.releaseFence()
      ()
    }
  private var executionStart: Long
  final def executionStart(): Long = Playground.executionStart
  private var scala$App$$_args: String[]
  def scala$App$$_args(): String[] = Playground.scala$App$$_args
  private var scala$App$$initCode: scala.collection.mutable.ListBuffer
  def scala$App$$initCode(): scala.collection.mutable.ListBuffer =
    Playground.scala$App$$initCode
  def scala$App$$_args_=(x$1: String[]): Unit =
    Playground.scala$App$$_args = x$1
  def scala$App$_setter_$executionStart_$eq(x$0: Long): Unit =
    Playground.executionStart = x$0
  def scala$App$_setter_$scala$App$$initCode_$eq(
    x$0: scala.collection.mutable.ListBuffer): Unit =
    Playground.scala$App$$initCode = x$0
  protected final def args(): String[] = super[App].args()
  @deprecated(message = "the delayedInit mechanism will disappear",
    since = "2.11.0") override def delayedInit(body: Function0): Unit =
    super[App].delayedInit(body)
  final def main(args: String[]): Unit = super[App].main(args)
  private def writeReplace(): Object =
    new scala.runtime.ModuleSerializationProxy(classOf[Playground])
  private val instrumentationMap: scala.collection.mutable.Map
  def instrumentations(): scala.collection.immutable.List =
    Playground.instrumentationMap.toList().map(
      {
        def $anonfun(x$1: Tuple2): com.olegych.scastie.api.Instrumentation =
          matchResult1[com.olegych.scastie.api.Instrumentation]: 
            {
              case val x1: Tuple2 = x$1
              if x1.ne(null) then
                {
                  case val pos: com.olegych.scastie.api.Position =
                    x1._1().asInstanceOf[com.olegych.scastie.api.Position]
                  case val r: com.olegych.scastie.api.Render =
                    x1._2().asInstanceOf[com.olegych.scastie.api.Render]
                  return[matchResult1]
                    {
                      _root_.com.olegych.scastie.api.Instrumentation.apply(pos,
                        r)
                    }
                }
               else ()
              throw new MatchError(x1)
            }
        closure($anonfun)
      }
    )
  final lazy module val Example: Playground.Example = new Playground.Example()
  final module class Example extends Object {
    def <init>(): Unit =
      {
        super()
        Playground.Example.pf =
          {
            final class $anon extends scala.runtime.AbstractPartialFunction, 
              java.io.Serializable {
              def <init>(): Unit =
                {
                  super()
                  ()
                }
              override final def isDefinedAt(x: scala.runtime.BoxedUnit):
                Boolean =
                matchResult3[Boolean]: 
                  {
                    case val x5: scala.runtime.BoxedUnit =
                      {
                        matchResult2[Unit]: 
                          {
                            case val x4: scala.runtime.BoxedUnit = x
                            case val a: scala.runtime.BoxedUnit = x4
                            return[matchResult2]
                              {
                                ()
                              }
                          }
                        scala.runtime.BoxedUnit.UNIT
                      }
                    case val a: scala.runtime.BoxedUnit = x5
                    return[matchResult3] true
                  }
              override final def applyOrElse(x: scala.runtime.BoxedUnit,
                default: Function1): Object =
                {
                  matchResult5[Unit]: 
                    {
                      case val x7: scala.runtime.BoxedUnit =
                        {
                          matchResult4[Unit]: 
                            {
                              case val x6: scala.runtime.BoxedUnit = x
                              case val a: scala.runtime.BoxedUnit = x6
                              return[matchResult4]
                                {
                                  ()
                                }
                            }
                          scala.runtime.BoxedUnit.UNIT
                        }
                      case val a: scala.runtime.BoxedUnit = x7
                      return[matchResult5]
                        {
                          ()
                        }
                    }
                  scala.runtime.BoxedUnit.UNIT
                }
              override final def isDefinedAt(x: Object): Boolean =
                this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
              override final def applyOrElse(x: Object, default: Function1):
                Object =
                this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit],
                  default)
            }
            new 
              scala.runtime.AbstractPartialFunction with java.io.Serializable
                {...}
            ():scala.runtime.AbstractPartialFunction
          }
        ()
      }
    private def writeReplace(): Object =
      new scala.runtime.ModuleSerializationProxy(classOf[Playground.Example])
    private val pf: PartialFunction
    def pf(): PartialFunction = Playground.Example.pf
  }
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing @SourceFile("src/main/scala/main.scala") final module class Playground extends
  Object, com.olegych.scastie.api.runtime.package.ScastieApp {
  def <init>(): Unit =
    {
      super()
      super[App].<init>()
      Playground.instrumentationMap =
        _root_.scala.collection.mutable.Map.empty().asInstanceOf[
          scala.collection.mutable.Map]
      scala.runtime.Statics.releaseFence()
      ()
    }
  private var executionStart: Long
  final def executionStart(): Long = Playground.executionStart
  private var scala$App$$_args: String[]
  def scala$App$$_args(): String[] = Playground.scala$App$$_args
  private var scala$App$$initCode: scala.collection.mutable.ListBuffer
  def scala$App$$initCode(): scala.collection.mutable.ListBuffer =
    Playground.scala$App$$initCode
  def scala$App$$_args_=(x$1: String[]): Unit =
    Playground.scala$App$$_args = x$1
  def scala$App$_setter_$executionStart_$eq(x$0: Long): Unit =
    Playground.executionStart = x$0
  def scala$App$_setter_$scala$App$$initCode_$eq(
    x$0: scala.collection.mutable.ListBuffer): Unit =
    Playground.scala$App$$initCode = x$0
  protected final def args(): String[] = super[App].args()
  @deprecated(message = "the delayedInit mechanism will disappear",
    since = "2.11.0") override def delayedInit(body: Function0): Unit =
    super[App].delayedInit(body)
  final def main(args: String[]): Unit = super[App].main(args)
  private def writeReplace(): Object =
    new scala.runtime.ModuleSerializationProxy(classOf[Playground])
  private val instrumentationMap: scala.collection.mutable.Map
  def instrumentations(): scala.collection.immutable.List =
    Playground.instrumentationMap.toList().map(
      {
        def $anonfun(x$1: Tuple2): com.olegych.scastie.api.Instrumentation =
          matchResult1[com.olegych.scastie.api.Instrumentation]: 
            {
              case val x1: Tuple2 = x$1
              if x1.ne(null) then
                {
                  case val pos: com.olegych.scastie.api.Position =
                    x1._1().asInstanceOf[com.olegych.scastie.api.Position]
                  case val r: com.olegych.scastie.api.Render =
                    x1._2().asInstanceOf[com.olegych.scastie.api.Render]
                  return[matchResult1]
                    {
                      _root_.com.olegych.scastie.api.Instrumentation.apply(pos,
                        r)
                    }
                }
               else ()
              throw new MatchError(x1)
            }
        closure($anonfun)
      }
    )
  final lazy module val Example: Playground.Example = new Playground.Example()
  final module class Example extends Object {
    def <init>(): Unit =
      {
        super()
        Playground.Example.pf =
          {
            final class $anon extends scala.runtime.AbstractPartialFunction, 
              java.io.Serializable {
              def <init>(): Unit =
                {
                  super()
                  ()
                }
              override final def isDefinedAt(x: scala.runtime.BoxedUnit):
                Boolean =
                matchResult3[Boolean]: 
                  {
                    case val x5: scala.runtime.BoxedUnit =
                      {
                        matchResult2[Unit]: 
                          {
                            case val x4: scala.runtime.BoxedUnit = x
                            case val a: scala.runtime.BoxedUnit = x4
                            return[matchResult2]
                              {
                                ()
                              }
                          }
                        scala.runtime.BoxedUnit.UNIT
                      }
                    case val a: scala.runtime.BoxedUnit = x5
                    return[matchResult3] true
                  }
              override final def applyOrElse(x: scala.runtime.BoxedUnit,
                default: Function1): Object =
                {
                  matchResult5[Unit]: 
                    {
                      case val x7: scala.runtime.BoxedUnit =
                        {
                          matchResult4[Unit]: 
                            {
                              case val x6: scala.runtime.BoxedUnit = x
                              case val a: scala.runtime.BoxedUnit = x6
                              return[matchResult4]
                                {
                                  ()
                                }
                            }
                          scala.runtime.BoxedUnit.UNIT
                        }
                      case val a: scala.runtime.BoxedUnit = x7
                      return[matchResult5]
                        {
                          ()
                        }
                    }
                  scala.runtime.BoxedUnit.UNIT
                }
              override final def isDefinedAt(x: Object): Boolean =
                this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
              override final def applyOrElse(x: Object, default: Function1):
                Object =
                this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit],
                  default)
            }
            new 
              scala.runtime.AbstractPartialFunction with java.io.Serializable
                {...}
            ():scala.runtime.AbstractPartialFunction
          }
        ()
      }
    private def writeReplace(): Object =
      new scala.runtime.ModuleSerializationProxy(classOf[Playground.Example])
    private val pf: PartialFunction
    def pf(): PartialFunction = Playground.Example.pf
  }
}
java.util.NoSuchElementException: key not found: method $anonfun while traversing package <empty> {
  final lazy module val Playground: Playground = new Playground()
  @SourceFile("src/main/scala/main.scala") final module class Playground extends
     Object, com.olegych.scastie.api.runtime.package.ScastieApp {
    def <init>(): Unit =
      {
        super()
        super[App].<init>()
        Playground.instrumentationMap =
          _root_.scala.collection.mutable.Map.empty().asInstanceOf[
            scala.collection.mutable.Map]
        scala.runtime.Statics.releaseFence()
        ()
      }
    private var executionStart: Long
    final def executionStart(): Long = Playground.executionStart
    private var scala$App$$_args: String[]
    def scala$App$$_args(): String[] = Playground.scala$App$$_args
    private var scala$App$$initCode: scala.collection.mutable.ListBuffer
    def scala$App$$initCode(): scala.collection.mutable.ListBuffer =
      Playground.scala$App$$initCode
    def scala$App$$_args_=(x$1: String[]): Unit =
      Playground.scala$App$$_args = x$1
    def scala$App$_setter_$executionStart_$eq(x$0: Long): Unit =
      Playground.executionStart = x$0
    def scala$App$_setter_$scala$App$$initCode_$eq(
      x$0: scala.collection.mutable.ListBuffer): Unit =
      Playground.scala$App$$initCode = x$0
    protected final def args(): String[] = super[App].args()
    @deprecated(message = "the delayedInit mechanism will disappear",
      since = "2.11.0") override def delayedInit(body: Function0): Unit =
      super[App].delayedInit(body)
    final def main(args: String[]): Unit = super[App].main(args)
    private def writeReplace(): Object =
      new scala.runtime.ModuleSerializationProxy(classOf[Playground])
    private val instrumentationMap: scala.collection.mutable.Map
    def instrumentations(): scala.collection.immutable.List =
      Playground.instrumentationMap.toList().map(
        {
          def $anonfun(x$1: Tuple2): com.olegych.scastie.api.Instrumentation =
            matchResult1[com.olegych.scastie.api.Instrumentation]: 
              {
                case val x1: Tuple2 = x$1
                if x1.ne(null) then
                  {
                    case val pos: com.olegych.scastie.api.Position =
                      x1._1().asInstanceOf[com.olegych.scastie.api.Position]
                    case val r: com.olegych.scastie.api.Render =
                      x1._2().asInstanceOf[com.olegych.scastie.api.Render]
                    return[matchResult1]
                      {
                        _root_.com.olegych.scastie.api.Instrumentation.apply(
                          pos, r)
                      }
                  }
                 else ()
                throw new MatchError(x1)
              }
          closure($anonfun)
        }
      )
    final lazy module val Example: Playground.Example = new Playground.Example()
    final module class Example extends Object {
      def <init>(): Unit =
        {
          super()
          Playground.Example.pf =
            {
              final class $anon extends scala.runtime.AbstractPartialFunction, 
                java.io.Serializable {
                def <init>(): Unit =
                  {
                    super()
                    ()
                  }
                override final def isDefinedAt(x: scala.runtime.BoxedUnit):
                  Boolean =
                  matchResult3[Boolean]: 
                    {
                      case val x5: scala.runtime.BoxedUnit =
                        {
                          matchResult2[Unit]: 
                            {
                              case val x4: scala.runtime.BoxedUnit = x
                              case val a: scala.runtime.BoxedUnit = x4
                              return[matchResult2]
                                {
                                  ()
                                }
                            }
                          scala.runtime.BoxedUnit.UNIT
                        }
                      case val a: scala.runtime.BoxedUnit = x5
                      return[matchResult3] true
                    }
                override final def applyOrElse(x: scala.runtime.BoxedUnit,
                  default: Function1): Object =
                  {
                    matchResult5[Unit]: 
                      {
                        case val x7: scala.runtime.BoxedUnit =
                          {
                            matchResult4[Unit]: 
                              {
                                case val x6: scala.runtime.BoxedUnit = x
                                case val a: scala.runtime.BoxedUnit = x6
                                return[matchResult4]
                                  {
                                    ()
                                  }
                              }
                            scala.runtime.BoxedUnit.UNIT
                          }
                        case val a: scala.runtime.BoxedUnit = x7
                        return[matchResult5]
                          {
                            ()
                          }
                      }
                    scala.runtime.BoxedUnit.UNIT
                  }
                override final def isDefinedAt(x: Object): Boolean =
                  this.isDefinedAt(x.asInstanceOf[scala.runtime.BoxedUnit])
                override final def applyOrElse(x: Object, default: Function1):
                  Object =
                  this.applyOrElse(x.asInstanceOf[scala.runtime.BoxedUnit],
                    default)
              }
              new 
                scala.runtime.AbstractPartialFunction with java.io.Serializable
                  {...}
              ():scala.runtime.AbstractPartialFunction
            }
          ()
        }
      private def writeReplace(): Object =
        new scala.runtime.ModuleSerializationProxy(classOf[Playground.Example])
      private val pf: PartialFunction
      def pf(): PartialFunction = Playground.Example.pf
    }
  }
  final lazy module val Main: Main = new Main()
  @SourceFile("src/main/scala/main.scala") final module class Main extends 
    Object {
    def <init>(): Unit =
      {
        super()
        Main.playground = Playground
        ()
      }
    private def writeReplace(): Object =
      new scala.runtime.ModuleSerializationProxy(classOf[Main])
    def suppressUnusedWarnsScastie(): com.olegych.scastie.api.Html =
      com.olegych.scastie.api.runtime.Html()
    private val playground: Playground
    def playground(): Playground = Main.playground
    def main(args: String[]): Unit =
      {
        Main.playground().main([ : String].asInstanceOf[String[]])
        scala.Predef.println(
          "\n".+(
            _root_.com.olegych.scastie.api.runtime.Runtime.write(
              Main.playground().instrumentations())
          )
        )
      }
  }
}

  unhandled exception while running MegaPhase{lambdaLift, elimStaticThis, countOuterAccesses} on /tmp/scastie16092225585572490684/src/main/scala/main.scala

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/lampepfl/dotty/issues/new/choose
  For non-enriched exceptions, compile with -Yno-enrich-error-messages.

     while compiling: /tmp/scastie16092225585572490684/src/main/scala/main.scala
        during phase: MegaPhase{lambdaLift, elimStaticThis, countOuterAccesses}
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.15
    compiler version: version 3.3.5
            settings: -classpath /tmp/scastie16092225585572490684/target/scala-3.3.5/classes:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.5/scala3-library_3-3.3.5.jar:/home/sbtRunnerContainer/.ivy2/local/org.scastie/runtime-scala_3/1.0.0-SNAPSHOT/jars/runtime-scala_3.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.15/scala-library-2.13.15.jar:/home/sbtRunnerContainer/.ivy2/local/org.scastie/api_3/0.30.0-SNAPSHOT/jars/api_3.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-json_3/2.10.0-RC5/play-json_3-2.10.0-RC5.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/typesafe/play/play-functional_3/2.10.0-RC5/play-functional_3-2.10.0-RC5.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.4/jackson-core-2.11.4.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.4/jackson-annotations-2.11.4.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.4/jackson-datatype-jdk8-2.11.4.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.4/jackson-datatype-jsr310-2.11.4.jar:/home/sbtRunnerContainer/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar -d /tmp/scastie16092225585572490684/target/scala-3.3.5/classes -deprecation true -feature true
@m50d m50d added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 3, 2025
@Gedochao Gedochao added area:pattern-matching and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 3, 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

2 participants