summaryrefslogtreecommitdiff
path: root/test/files/neg/valueclasses.check
blob: 30ee6895110d74bec8a503607de8d72b9d47ac93 (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
valueclasses.scala:3: error: Only classes (not traits) are allowed to extend AnyVal
trait T extends AnyVal // fail
      ^
valueclasses.scala:6: error: Value class may not be a member of another class
  class Bar(x: Int) extends AnyVal // fail
        ^
valueclasses.scala:8: error: Value class may not be a local class
    class Baz(x: Int) extends AnyVal // fail
          ^
valueclasses.scala:12: error: Value class needs to have exactly one public val parameter
class V1 extends AnyVal // fail
      ^
valueclasses.scala:14: error: Value class needs to have a publicly accessible val parameter
class V2(private[test] val x: Int) extends AnyVal // fail
                           ^
valueclasses.scala:15: error: Value class needs to have a publicly accessible val parameter
class V3(protected[test] val x: Int) extends AnyVal // fail
                             ^
valueclasses.scala:16: error: Value class needs to have a publicly accessible val parameter
class V4(protected val x: Int) extends AnyVal // fail
                       ^
valueclasses.scala:17: error: Value class needs to have a publicly accessible val parameter
class V5(private val x: Int) extends AnyVal // fail
                     ^
valueclasses.scala:19: error: Value class needs to have exactly one public val parameter
class V6(val x: Int, val y: String) extends AnyVal // fail
      ^
valueclasses.scala:20: error: Illegal parameter for value class
class V7(val x: Int, private[this] val y: String) extends AnyVal // fail
                                       ^
valueclasses.scala:21: error: Value class needs to have exactly one public val parameter
class V8(var x: Int) extends AnyVal // fail
      ^
valueclasses.scala:24: error: This statement is not allowed in value class: private[this] val y: Int = V9.this.x
  val y = x    // fail
      ^
valueclasses.scala:29: error: type parameter of value class may not be specialized
class V12[@specialized T, U](val x: (T, U)) extends AnyVal // fail
                       ^
valueclasses.scala:31: error: Value class needs to have exactly one public val parameter
class V13(x: Int) extends AnyVal // fail
      ^
14 errors found