Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

Export more stuff from this #148

@som-snytt

Description

@som-snytt

I'd like to export a member with rename, in the manner of @targetName.

object Stuff:
  def f = ???
  export this.{f => g}

I'd like to export an opaque type in order to make it transparent, with the alias opaque by default. (-Yopaque-by-default?)

object Stuff:
  /* opaque */ type Name = String
  export this.Name
object other:
  val n: Stuff.Name = "hello, world"

I'd like to export my companion, where a companion is nested instead of sibling.

class Stuff:
  def f = ???
  object Stuff:
    def g = f  // obviously not, context of companion is as usual
  export this.Stuff  // named companion is available
  object Staff
  export this.Staff  // error: not a companion
  export this.{Staff => Stuff}  // not a companion
  object:            // anonymous companion! which is more natural for implicits/givens, no danger of typo
    def apply() = ???
    given ...
object other:
  Stuff.m  // normal companion reference, not Stuff.Stuff.m

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