Skip to content

Value types are not properly compared in TypeComparer #2430

Closed
@felixmulder

Description

@felixmulder

The following subtyping test fails Ycheck after erasure:

class Test1(val x: Int) extends AnyVal
class Test2(val y: Test1) extends AnyVal

In tree checker:

tree.tpe <:< pt // tree.tpe = ErasedValueType(Test2, ErasedValueType(Test1, Int))($this)
                //       pt = Int

This is what causes erasure not to be Ycheckable. The next phase, ElimErasedValueType, removes the ErasedValueTypes and casts so that it is again, Ycheckable.

ping @odersky

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