aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/io/Jar.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-18 18:21:10 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-18 18:21:23 +0100
commitf11dea6fc2eed56bee3eb1999c3890aae958e897 (patch)
treeefc124dc4151fddfae36b86689a24df12d9e2ec9 /src/dotty/tools/io/Jar.scala
parentd172c1687eb4558369616696d93ed944f2fc8776 (diff)
downloaddotty-f11dea6fc2eed56bee3eb1999c3890aae958e897.tar.gz
dotty-f11dea6fc2eed56bee3eb1999c3890aae958e897.tar.bz2
dotty-f11dea6fc2eed56bee3eb1999c3890aae958e897.zip
Fix to computation of implicit scopes
For packages, the implicit scope consists of the implicit definitions in a nested `package` object, not the package itself.
Diffstat (limited to 'src/dotty/tools/io/Jar.scala')
-rw-r--r--src/dotty/tools/io/Jar.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/io/Jar.scala b/src/dotty/tools/io/Jar.scala
index 01d30b76f..42efc7e06 100644
--- a/src/dotty/tools/io/Jar.scala
+++ b/src/dotty/tools/io/Jar.scala
@@ -86,24 +86,24 @@ class JarWriter(val file: File, val manifest: Manifest) {
new DataOutputStream(out)
}
- def writeAllFrom(dir: Directory) {
+ def writeAllFrom(dir: Directory): Unit = {
try dir.list foreach (x => addEntry(x, ""))
finally out.close()
}
- def addStream(entry: JarEntry, in: InputStream) {
+ def addStream(entry: JarEntry, in: InputStream): Unit = {
out putNextEntry entry
try transfer(in, out)
finally out.closeEntry()
}
- def addFile(file: File, prefix: String) {
+ def addFile(file: File, prefix: String): Unit = {
val entry = new JarEntry(prefix + file.name)
addStream(entry, file.inputStream())
}
- def addEntry(entry: Path, prefix: String) {
+ def addEntry(entry: Path, prefix: String): Unit = {
if (entry.isFile) addFile(entry.toFile, prefix)
else addDirectory(entry.toDirectory, prefix + entry.name + "/")
}
- def addDirectory(entry: Directory, prefix: String) {
+ def addDirectory(entry: Directory, prefix: String): Unit = {
entry.list foreach (p => addEntry(p, prefix))
}
@@ -165,7 +165,7 @@ object Jar {
def isJarOrZip(f: Path, examineFile: Boolean): Boolean =
f.hasExtension("zip", "jar") || (examineFile && magicNumberIsZip(f))
- def create(file: File, sourceDir: Directory, mainClass: String) {
+ def create(file: File, sourceDir: Directory, mainClass: String): Unit = {
val writer = new Jar(file).jarWriter(Name.MAIN_CLASS -> mainClass)
writer writeAllFrom sourceDir
}