diff options
author | Steven Scott <steven@codemettle.com> | 2015-02-06 12:06:38 -0500 |
---|---|---|
committer | Steven Scott <steven@codemettle.com> | 2015-02-06 15:08:11 -0500 |
commit | b690ef83c13dc04521fda7eea04db8aec6effa08 (patch) | |
tree | 53aa51cfc66613a2f39d88aee9c0e4fb0b6e0d17 /test/files | |
parent | 178e8df9b6a91375a6162721a0cbc2d90bcc7451 (diff) | |
download | scala-b690ef83c13dc04521fda7eea04db8aec6effa08.tar.gz scala-b690ef83c13dc04521fda7eea04db8aec6effa08.tar.bz2 scala-b690ef83c13dc04521fda7eea04db8aec6effa08.zip |
Declare FiniteDuration.toCoarsest to return a FiniteDuration
FiniteDuration.toCoarsest is declared with a return type of Duration
even though it can only ever return a FiniteDuration. Change the
declaration to return a FiniteDuration so that using this method
doesn't require a cast or pattern match on the result in cases where
a FiniteDuration is required.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/duration-coarsest.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala index 51cb79287a..81fbb3cc84 100644 --- a/test/files/run/duration-coarsest.scala +++ b/test/files/run/duration-coarsest.scala @@ -25,4 +25,7 @@ object Test extends App { 23 hours, 40 days ) foreach (x => assert(x == x.toCoarsest, x)) -}
\ No newline at end of file + + // toCoarsest on a FiniteDuration should return a FiniteDuration + val finite: FiniteDuration = 1.second.toCoarsest +} |