Skip to content

lambda + PartialFunction + specialization = "VerifyError: Bad local variable type" #11817

Open
@SethTisue

Description

@SethTisue

this came up over at #7288, the original report there got fixed but this version remains broken even in 2.13.1

object SI_7288 {
  type Id[A] = A
  def f[A](pf: PartialFunction[A, Unit]): Unit = ()
  f[Id[Int]] { case _ => }
  def main(args: Array[String]): Unit = ()
}

Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
  Location:
    Main$$anonfun$1.applyOrElse(ILscala/Function1;)Ljava/lang/Object; @0: aload_1
  Reason:
    Type integer (current frame, locals[1]) is not assignable to reference type

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions