Skip to content

Type alias with type param becomes type alias applied to Nothing #7841

Closed
@Katrix

Description

@Katrix

minimized code

type Foo[A <: Int with Singleton] = AnyRef
def bar[A <: Int with Singleton](foo: Foo[A])(implicit v: ValueOf[A]): Int = v.value

val res = bar((???): Foo[10])

If the type parameter is used in some way on the right of the alias, then it won't be replaced with Nothing.

expectation

Compiles, like it does with Scala 2

The type is handed to the compiler on a silver plater. While I understand type aliases can be unstable, I'd assume they wouldn't be this unstable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions