Skip to content

Erasure doesn't insert all box\unbox corsions for ifs #355

@DarkDimius

Description

@DarkDimius
    def id[T](t: T) = t
    { if (x) id(one) else 0} + 1
    { if (x) new scala.util.Random()}.asInstanceOf[Runnable]

After erasure both those if's have different types of branches:

    { if (x) id(box(one)) else 0} + 1
    { if (x) new scala.util.Random() else ()}.asInstanceOf[Runnable]

In first example id should get unboxed,
In the second example () should get boxed.

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