aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t6259.scala
blob: 9b4d76b519bde4b154230d2b5bccf241bfdbeca7 (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
import scala.reflect.runtime.universe._

class A[X](implicit val tt: TypeTag[X]) {}
object B extends A[String]

object C {
  object D extends A[String]
}

trait E {
  object F extends A[String]
}

class G {
  object H extends A[String]
}

object HasX {
  val x = {
    object InVal extends A[String]
    InVal
    5
  }

}

trait NeedsEarly {
 val x: AnyRef
}

object Early extends NeedsEarly {
// TODO NEEDS MANUAL CHANGE (early initializers)
// BEGIN copied early initializers
val x = { object EarlyOk extends A[String]; EarlyOk }
// END copied early initializers
}


class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X]

object DoubleOk extends DoubleTrouble[String]({
  // Drops to this.getClass and is an issue
  object InnerTrouble extends A[String];
  InnerTrouble
})

object Test extends dotty.runtime.LegacyApp {
  B
  C.D
  val e = new E {}; e.F
  val g = new G; g.H

  locally(HasX.x)
  // locally(Early.x) TODO sort out VerifyError in Early$.<init>
  // DoubleOk         TODO sort out VerifyError in DoubleOk$.<init>
}