Skip to content

Commit 32b1ff7

Browse files
committed
Open patch file for writing later
Open patch file for writing later only once all patches are applied, so that any assertion errors during patch generation cannot result in an empty output file.
1 parent 3a457fa commit 32b1ff7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ object Rewrites {
5151
}
5252

5353
def writeBack(): Unit = {
54-
val out = source.file.output
5554
val chars = apply(source.underlying.content)
5655
val bytes = new String(chars).getBytes
56+
val out = source.file.output
5757
out.write(bytes)
5858
out.close()
5959
}

0 commit comments

Comments
 (0)