-
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.
Package object members are not conflicting with inherited
- Loading branch information
Showing
4 changed files
with
88 additions
and
13 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,36 @@ | ||
package object p extends p.U { | ||
def b: Int = 0 | ||
trait Y | ||
} | ||
|
||
package p { | ||
trait U { | ||
def a: Int = 0 | ||
trait X | ||
} | ||
|
||
object c | ||
def c1 = 0 // top-level def | ||
trait Z | ||
trait T { | ||
def a = 1 | ||
def b = 1 | ||
def c = 1 | ||
def c1 = 1 | ||
|
||
trait X | ||
trait Y | ||
trait Z | ||
} | ||
|
||
trait RR extends T { | ||
def m1 = a // ok | ||
def m2 = b // ok | ||
def m3 = c // error | ||
def m4 = c1 // error | ||
|
||
def n1: X // ok | ||
def n2: Y // ok | ||
def n3: Z // error | ||
} | ||
} |
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,4 @@ | ||
package object p extends p.U { | ||
def b: Int = 0 | ||
trait Y | ||
} |
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,31 @@ | ||
package p { | ||
trait U { | ||
def a: Int = 0 | ||
trait X | ||
} | ||
|
||
object c | ||
def c1 = 0 // top-level def | ||
trait Z | ||
trait T { | ||
def a = 1 | ||
def b = 1 | ||
def c = 1 | ||
def c1 = 1 | ||
|
||
trait X | ||
trait Y | ||
trait Z | ||
} | ||
|
||
trait RR extends T { | ||
def m1 = a // ok | ||
def m2 = b // ok | ||
def m3 = c // error | ||
def m4 = c1 // error | ||
|
||
def n1: X // ok | ||
def n2: Y // ok | ||
def n3: Z // error | ||
} | ||
} |