From 7641a9480702a91f271de52ce8bb1d9dd73f7121 Mon Sep 17 00:00:00 2001 From: odersky Date: Tue, 7 May 2024 21:38:33 +0200 Subject: [PATCH] Unbreak the build For some reason, BestEffortTastyWriter does not compile since PlainFile does not have a delete method, only File does. --- .../dotty/tools/dotc/core/tasty/BestEffortTastyWriter.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/BestEffortTastyWriter.scala b/compiler/src/dotty/tools/dotc/core/tasty/BestEffortTastyWriter.scala index 9cdfb042b8fb..7a170b5c0cfb 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/BestEffortTastyWriter.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/BestEffortTastyWriter.scala @@ -18,12 +18,13 @@ object BestEffortTastyWriter: unit.pickled.foreach { (clz, binary) => val parts = clz.fullName.mangledString.split('.') val outPath = outputPath(parts.toList, dir) - val outTastyFile = new PlainFile(new File(outPath)) + val file = new File(outPath) + val outTastyFile = new PlainFile(file) val outstream = new DataOutputStream(outTastyFile.bufferedOutput) try outstream.write(binary()) catch case ex: ClosedByInterruptException => try - outTastyFile.delete() // don't leave an empty or half-written tastyfile around after an interrupt + file.delete() // don't leave an empty or half-written tastyfile around after an interrupt catch case _: Throwable => throw ex