Skip to content

Regression: new <type alias> should compile #11781

Closed
@japgolly

Description

@japgolly

Compiler version

3.0.0-RC1

Minimized code

object Ah {
  final case class Values[B, +A](a: A)

  trait Object[B] {
    final type Values[+A] = Ah.Values[B, A]
    object Values {
      def blah: Values[Unit] =
        new Values(())
    }
  }
}

Output

-- Error: as.scala:8:12 --------------------------------------------------------
8 |        new Values(())
  |            ^^^^^^
  |            Object.this.Values is not a class type
-- Error: as.scala:8:19 --------------------------------------------------------
8 |        new Values(())
  |                   ^^
  |     too many arguments for constructor Object in class Object: (): Object
2 errors found

Expectation

It should compile. It compiles with Scala 2.12 and 2.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions