Skip to content

Private types can be inferred but not explicitly typed #10366

Closed as not planned
Closed as not planned
@ShaneDelmore

Description

@ShaneDelmore

Two examples:
https://scastie.scala-lang.org/wdskxrQQRbeB2ZHkDdXaoA

And

package factory{
  private [factory] class Factory
  object Factory{
    def f(): factory.Factory = new Factory()
  }
}
object G {
 //type annotation fails to compile!
  val f: factory.Factory = factory.Factory.f()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions