Lyricdev
GitHub

LYR-MIG0409

a close that a using says

hint · spec 14-cli

A note of lyric fix --from-4: defer stream.close(f) closes by hand what a using binding closes in Lyric 5.

Explanation

Lyric 5's using let f = … closes what it holds when the block ends, on every way out, for anything that is Closeable. The migration leaves the defer and says where one would do: write using let f = … and take the defer away.

Example

proposal[LYR-MIG0409] main.lyr:6:9: 'defer' closes 'f' by hand; Lyric 5 closes what a 'using' binding holds — write 'using let f = …' and take the 'defer' away