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

Export more stuff from this #148

Open
som-snytt opened this issue Nov 19, 2020 · 0 comments
Open

Export more stuff from this #148

som-snytt opened this issue Nov 19, 2020 · 0 comments

Comments

@som-snytt
Copy link

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
odersky added a commit to dotty-staging/dotty that referenced this issue Jan 31, 2021
More test cases and fixes for simple renaming imports. Disallow
them for exports for now, since the primary use case of a renaming
export is not handled yet: lampepfl/dotty-feature-requests#148
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 5, 2021
More test cases and fixes for simple renaming imports. Disallow
them for exports for now, since the primary use case of a renaming
export is not handled yet: lampepfl/dotty-feature-requests#148
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant