File tree Expand file tree Collapse file tree 2 files changed +30
-30
lines changed Expand file tree Collapse file tree 2 files changed +30
-30
lines changed Original file line number Diff line number Diff line change 1
1
object Test1 {
2
- class A {
3
- override def toString : String = " A"
4
- }
5
- class B (a : A ) {
6
- export a .toString // error: no eligible member toString at B.this.a
7
- }
2
+ class A {
3
+ override def toString : String = " A"
4
+ }
5
+ class B (a : A ) {
6
+ export a .toString // error: no eligible member toString at B.this.a
7
+ }
8
8
}
9
9
10
10
object Test extends App {
11
- trait T {
12
- def foo : Int = 1
11
+ trait T {
12
+ def foo : Int = 1
13
13
def bar : Int
14
- }
15
- class A extends T {
16
- override def foo = 2
14
+ }
15
+ class A extends T {
16
+ override def foo = 2
17
17
override def bar = 2
18
- }
19
- class B (a : A ) extends T {
20
- export a .foo // error: no eligible member foo at B.this.a
18
+ }
19
+ class B (a : A ) extends T {
20
+ export a .foo // error: no eligible member foo at B.this.a
21
21
export a .bar // OK
22
- }
22
+ }
23
23
}
Original file line number Diff line number Diff line change 1
1
object Test1 {
2
- class A {
3
- override def toString : String = " A"
4
- }
5
- class B (a : A ) {
6
- export a ._ // OK
7
- }
2
+ class A {
3
+ override def toString : String = " A"
4
+ }
5
+ class B (a : A ) {
6
+ export a ._ // OK
7
+ }
8
8
}
9
9
10
10
object Test extends App {
11
- trait T {
12
- def foo : Int = 1
11
+ trait T {
12
+ def foo : Int = 1
13
13
def bar : Int
14
- }
15
- class A extends T {
16
- override def foo = 2
14
+ }
15
+ class A extends T {
16
+ override def foo = 2
17
17
override def bar = 2
18
- }
19
- class B (a : A ) extends T {
20
- export a ._
21
- }
18
+ }
19
+ class B (a : A ) extends T {
20
+ export a ._
21
+ }
22
22
val b = B (A ())
23
23
assert(b.foo == 1 )
24
24
assert(b.bar == 2 )
You can’t perform that action at this time.
0 commit comments