mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Make a struct's implicit reset method impure
This commit is contained in:
1 parent
8ab2a33aae
commit
5f9d007b1c
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -340,7 +340,7 @@ func (c *Checker) checkStructDecl(node *a.Node) error {
|
||||
|
||||
// A struct declaration implies a reset method.
|
||||
in := a.NewStruct(0, n.Filename(), n.Line(), t.IDArgs, nil)
|
||||
f := a.NewFunc(0, n.Filename(), n.Line(), qid[1], t.IDReset, in, nil, nil, nil)
|
||||
f := a.NewFunc(a.EffectImpure.AsFlags(), n.Filename(), n.Line(), qid[1], t.IDReset, in, nil, nil, nil)
|
||||
if qid[0] != 0 {
|
||||
f.AsNode().AsRaw().SetPackage(c.tm, qid[0])
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade
|
||||
// a coroutine-in-progress lzw_decoder.decode call, still waiting for that
|
||||
// end code. To cancel that coroutine, we reset the LZW decoder.
|
||||
if this.previous_lzw_decode_ended_abruptly {
|
||||
this.lzw.reset() // TODO: needs an ! effect.
|
||||
this.lzw.reset!()
|
||||
}
|
||||
|
||||
var lw base.u8 = args.src.read_u8!??()
|
||||
|
||||
Reference in new issue
Block a user