blob: 1a9932d7348da4e78491a2fafea95347f3bfc197 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// This one is unavoidable. Dotty does not allow several overloaded
// parameterless methods, so it picks the one in the subclass.
import scala.language.higherKinds
// Minimal reproduction for:
// scala.collection.mutable.ArrayStack.empty[Int]
abstract class Super[C[_]] {
def empty[T]: C[T] = ???
}
class Child[T]
object Child extends Super[Child] {
def empty: Child[Nothing] = new Child()
Child.empty[Int]
}
|