diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/valueclasses.check | 5 | ||||
-rw-r--r-- | test/files/neg/valueclasses.scala | 23 | ||||
-rw-r--r-- | test/files/run/valueclasses-constr.check | 10 |
3 files changed, 10 insertions, 28 deletions
diff --git a/test/files/neg/valueclasses.check b/test/files/neg/valueclasses.check index 756a0474fa..4f042faded 100644 --- a/test/files/neg/valueclasses.check +++ b/test/files/neg/valueclasses.check @@ -40,7 +40,4 @@ 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 ^ -valueclasses.scala:45: error: value class must have public primary constructor -final class TOD private (val secondsOfDay: Int) extends AnyVal { // should fail with private constructor - ^ -15 errors found +14 errors found diff --git a/test/files/neg/valueclasses.scala b/test/files/neg/valueclasses.scala index e405d95489..7cac94ab11 100644 --- a/test/files/neg/valueclasses.scala +++ b/test/files/neg/valueclasses.scala @@ -29,26 +29,3 @@ class V11[T](val x: List[T]) extends AnyVal // ok class V12[@specialized T, U](val x: (T, U)) extends AnyVal // fail class V13(x: Int) extends AnyVal // fail - - -package time { - -object TOD { - final val SecondsPerDay = 86400 - - def apply(seconds: Int) = { - val n = seconds % SecondsPerDay - new TOD(if (n >= 0) n else n + SecondsPerDay) - } -} - -final class TOD private (val secondsOfDay: Int) extends AnyVal { // should fail with private constructor - def hours = secondsOfDay / 3600 - def minutes = (secondsOfDay / 60) % 60 - def seconds = secondsOfDay % 60 - - override def toString = "%02d:%02d:%02d".format(hours, minutes, seconds) -} -} - - diff --git a/test/files/run/valueclasses-constr.check b/test/files/run/valueclasses-constr.check index df37fbc723..785e6fa25b 100644 --- a/test/files/run/valueclasses-constr.check +++ b/test/files/run/valueclasses-constr.check @@ -1,2 +1,10 @@ -0 +16 +00:16:40 +16 +00:16:40 +16 +00:16:40 +16 +00:16:40 +16 00:16:40 |