blob: a8bcc79d654c1b99a6eb6c11ab5440082d4301f0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class B {}
class A requires B {
def m(): B = {
this
}
}
object Exec{
def main(args: Array[String]): Unit = {
val a: A = new A; // should not be allowed
val b: B = a.m();
}
}
|