diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t5063.check | 4 | ||||
-rw-r--r-- | test/files/neg/t5063.scala | 3 | ||||
-rw-r--r-- | test/files/neg/valueclasses.check | 5 | ||||
-rw-r--r-- | test/files/neg/valueclasses.scala | 23 |
4 files changed, 8 insertions, 27 deletions
diff --git a/test/files/neg/t5063.check b/test/files/neg/t5063.check new file mode 100644 index 0000000000..84690d0a1d --- /dev/null +++ b/test/files/neg/t5063.check @@ -0,0 +1,4 @@ +t5063.scala:2: error: value + is not a member of Object + super.+("") + ^ +one error found diff --git a/test/files/neg/t5063.scala b/test/files/neg/t5063.scala new file mode 100644 index 0000000000..5b34b53fb7 --- /dev/null +++ b/test/files/neg/t5063.scala @@ -0,0 +1,3 @@ +class A { + super.+("") +} 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) -} -} - - |