Skip to content

Commit

Permalink
nimpretty: fixes nim-lang#9499
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored and narimiran committed Nov 1, 2018
1 parent 68313b8 commit b8497c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/layouter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ proc openEmitter*(em: var Emitter, cache: IdentCache;
em.lastLineNumber = 1

proc closeEmitter*(em: var Emitter) =
if fileExists(em.config.outFile) and readFile(em.config.outFile.string) == em.content:
discard "do nothing, see #9499"
return
var f = llStreamOpen(em.config.outFile, fmWrite)
if f == nil:
rawMessage(em.config, errGenerated, "cannot open file: " & em.config.outFile.string)
return
f.llStreamWrite em.content
llStreamClose(f)

Expand Down

0 comments on commit b8497c7

Please sign in to comment.