aboutsummaryrefslogblamecommitdiff
path: root/tests/pending/run/t3994.scala
blob: e9fc39f8110af175fe25a1080888c209b0733d1c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                                                                     
                                             


                             
trait T {
  trait Default { def foo = this }
  object Default extends Default
}

class Crash { // if you change this to a `trait` it keeps failing, though if it is an `object` it compiles just fine!
  class Element

  /* declare this as a class, and the crash goes away */
  trait ElementOrdering extends Ordering[Element] {
    def compare(a: Element, b: Element): Int = 0
  }

  implicit object ElementOrdering extends ElementOrdering
}

object Test extends dotty.runtime.LegacyApp {
  (new T {}).Default
  (new Crash).ElementOrdering
}