Skip to content

Non-local returns are not implemented #743

Closed
@DarkDimius

Description

@DarkDimius
object NonLocalReturn {
 def foo(a: List[Int]): Int = {
   a.foreach(x => return x)
   0
  }
}

Return will reach backend as part of

    private def $anonfun$foo$1(x: Int): Nothing = return x

triggering an error:

assertion failed: Expected primitive types I - Lscala/runtime/Nothing$;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions