Skip to content

Commit

Permalink
Add missing test file
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed Jun 13, 2024
1 parent 76b2cd9 commit 2ec34d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/mutable_value_semantics.t/dyn_partial_move.smu
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type wrap('a) = { a : 'a }

fun remove(optarr&, index):
let opt& = &optarr.[index.a]
match opt:
#some(thing):
let value = !thing.a
&opt <- #none
#some(value)
#none: #none

let optarr& = [#some({a = "thing"})]

remove(&optarr, {a = 0}).ignore()

0 comments on commit 2ec34d0

Please sign in to comment.