blob: 4befe1623d8c87da58637aaadaa3215fbe58ba49 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
abstract class FooA {
type A <: Ax;
abstract class Ax;
abstract class InnerA {
type B <: A;
def doB : B;
}
}
trait FooB extends FooA {
type A <: Ax;
trait Ax extends super.Ax { def xxx : Int; }
abstract class InnerB extends InnerA {
// type B <: A;
val a : A = doB;
a.xxx;
doB.xxx;
}
}
package p1 {
abstract class T1 {
protected def bug(p: Int = 1): Int // without 'protected' compiles fine
}
}
package p2 { // all being in the same package compiles fine
import p1._
abstract class T2 extends T1 {
class A {
bug()
}
}
abstract class T3 extends T2 {
class A {
bug()
}
}
}
class A[T] {
def f(x: T)(y: T = x) = y
}
class B extends A[Int] {
def f(x: Int)(y: Int) = y
f(2)()
}
class X {
def f: A[Int] = ???
}
class Y extends X {
def f: A[Int] = ???
}
|