Skip to content

Typer should preserve aliases in TypeTrees #1181

@smarter

Description

@smarter

Or at least, preserve them for aliases whose kind is different from the kind of their right-hand side

object Test {
  def foo[M[_]](x: M[Int]) = x

  type Alias[A] = (A, A)
  val x: Alias[Int] = (1, 2)

  foo[Alias](x) // ok
  foo(x) // ok in scalac but fails in dotty with:
         // error: type mismatch:
         //  found   : (Int, Int)
         //  required: M[Int]
}

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