diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala | 28 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala | 3 |
2 files changed, 8 insertions, 23 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index 813180a8c7..1b97681743 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -35,26 +35,14 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { /* * must-single-thread */ - def getOutFolder(csym: Symbol, cName: String, cunit: CompilationUnit): _root_.scala.tools.nsc.io.AbstractFile = Option { - try { - outputDirectory(csym) - } catch { - case ex: Throwable => - reporter.warning(cunit.body.pos, s"Couldn't find output folder for symbol source ${csym.name}. Dropping to compliation unit source.\n${ex.getMessage}") - null - } - }.orElse { Option { - try { - outputDirectory(cunit.source) - } catch { - case ex: Throwable => - reporter.warning(cunit.body.pos, s"Couldn't find output folder for compilation unit $cName\n${ex.getMessage}") - null - } - }}.orElse { - reporter.error(cunit.body.pos, s"Couldn't create file for class $cName") - None - }.orNull + def getOutFolder(csym: Symbol, cName: String, cunit: CompilationUnit): _root_.scala.tools.nsc.io.AbstractFile = + _root_.scala.util.Try { + outputDirectory(csym) + }.recover { + case ex: Throwable => + reporter.error(cunit.body.pos, s"Couldn't create file for class $cName\n${ex.getMessage}") + null + }.get var pickledBytes = 0 // statistics diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala index e4fcb729a2..1d29fdee10 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BytecodeWriters.scala @@ -25,9 +25,6 @@ trait BytecodeWriters { def outputDirectory(sym: Symbol): AbstractFile = settings.outputDirs outputDirFor enteringFlatten(sym.sourceFile) - def outputDirectory(cunitSource: scala.reflect.internal.util.SourceFile): AbstractFile = - settings.outputDirs outputDirFor cunitSource.file - /** * @param clsName cls.getName */ |