aboutsummaryrefslogblamecommitdiff
path: root/tests/neg/singletons.scala
blob: 2155bfe31d2bc976afbe5ef05395a32453747732 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
             


                                              


                                                                 
                                                                     

                                                               
 
object Test {
  val a: 42 = 43  // error: different constant
  val x = 42
  val z: 42 = x   // error: x is not final

  val n: null = null // error: Null is not a legal singleton type

  val sym: 'sym = 'sym // error: Symbol is not a legal singleton type

  val foo: s"abc" = "abc"  // error: not a legal singleton type
}