diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-03-01 10:11:49 +0100 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-03-01 13:03:44 +0100 |
commit | be5720c18ca6768c7e72d4258677952848db2bb4 (patch) | |
tree | a781b4f8b2772de09db54352d2d50602a1a0a4a6 /compiler/src/dotty/tools/io | |
parent | 1a490393d766039332bfccb8b85f264f22c9e9cc (diff) | |
download | dotty-be5720c18ca6768c7e72d4258677952848db2bb4.tar.gz dotty-be5720c18ca6768c7e72d4258677952848db2bb4.tar.bz2 dotty-be5720c18ca6768c7e72d4258677952848db2bb4.zip |
Add @tailrec to avoid regressions.
Diffstat (limited to 'compiler/src/dotty/tools/io')
-rw-r--r-- | compiler/src/dotty/tools/io/Jar.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/io/Jar.scala b/compiler/src/dotty/tools/io/Jar.scala index 42efc7e06..142226ea5 100644 --- a/compiler/src/dotty/tools/io/Jar.scala +++ b/compiler/src/dotty/tools/io/Jar.scala @@ -12,6 +12,7 @@ import java.util.jar._ import scala.collection.JavaConverters._ import Attributes.Name import scala.language.{postfixOps, implicitConversions} +import scala.annotation.tailrec // Attributes.Name instances: // @@ -109,7 +110,7 @@ class JarWriter(val file: File, val manifest: Manifest) { private def transfer(in: InputStream, out: OutputStream) = { val buf = new Array[Byte](10240) - def loop(): Unit = in.read(buf, 0, buf.length) match { + @tailrec def loop(): Unit = in.read(buf, 0, buf.length) match { case -1 => in.close() case n => out.write(buf, 0, n) ; loop } |