-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rule Out Exports of Member of the Current Class (#22545)
Fix #22147 Supersedes #22503 Co-authored-by: Jan-Pieter van den Heuvel <jan-pieter@users.noreply.github.com> Co-authored-by: Willem W Bakker <wwbakker@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
trait P: | ||
def foo: Int | ||
|
||
class A extends P: | ||
export this.foo // error | ||
|
||
trait Q extends P: | ||
def bar: Int | ||
|
||
trait R extends P: | ||
def baz: Int | ||
val a1: A | ||
val a2: A | ||
|
||
abstract class B extends R: | ||
self => | ||
export this.baz // error | ||
export self.bar // error | ||
export this.a1.foo | ||
export self.a2.foo // error | ||
export a2.foo // error | ||
|
||
abstract class D extends P: | ||
val p: P | ||
export p.foo | ||
|
||
abstract class E: | ||
self: P => | ||
export self.foo // error | ||
|
||
abstract class F: | ||
self: P => | ||
export this.foo // error | ||
|
||
class G(p: P): | ||
self: P => | ||
export p.foo | ||
|
||
class H(p: P): | ||
self: P => | ||
export this.p.foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters