summaryrefslogtreecommitdiff
path: root/test/files/run/SD-290.scala
blob: 0af9cb7cfa4f0bf8be4b484e3f56dfb85d5407e9 (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
object p1 {
  class B
  object B

  class C extends java.io.Serializable
  object C

  type D = DD
  object D
}
package object p2 {
  class B
  object B

  class C extends java.io.Serializable
  object C

  type D = DD
  object D

}
class DD extends java.io.Serializable

object Test {
  def main(args: Array[String]): Unit = {

    // This is the behaviour that was intended and was unchanged by this commmit.
    assert(!(p1.B : Object).isInstanceOf[scala.Serializable])
    assert(p1.C.isInstanceOf[scala.Serializable])
    assert(!(p1.D: Object).isInstanceOf[scala.Serializable])

    assert(!(p2.B : Object).isInstanceOf[scala.Serializable])
    assert(p2.C.isInstanceOf[scala.Serializable])

    // this behaviour was different in 2.12.1 and earlier due to a bug
    // in companionSymbolOf
    assert(!(p2.D: Object).isInstanceOf[scala.Serializable])
  }
}