Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine typing of export forwarders #8408

Merged
merged 2 commits into from Mar 1, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 1, 2020

An export forwarder is now of singleton type only if the export path does not
refer to private values. Previously, this situation would lead to a type error
later on, like this one:

scala> class A{
     |   val x: Int = 1
     | }
     | class B(a: A){
     |   export a.x
     | }
5 |  export a.x
  |           ^
  |           non-private method x in class B refers to private value a
  |           in its type signature => (B.this.a.x : Int)

An export forwarder is now of singleton type only if the export path does not
refer to private values. Previously, this situation would lead to a type error
later on, like this one:
```scala
scala> class A{
     |   val x: Int = 1
     | }
     | class B(a: A){
     |   export a.x
     | }
5 |  export a.x
  |           ^
  |           non-private method x in class B refers to private value a
  |           in its type signature => (B.this.a.x : Int)
```
@smarter smarter merged commit c6b681c into scala:master Mar 1, 2020
@smarter smarter deleted the fix-export-stable branch March 1, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants