Skip to content

Commit 2fb4b6d

Browse files
committed
Fix val-to-val test assertions to match conservative might_reference_actor
make_might_reference_actor currently always returns true, so immutable tracing recurses into fields. The test incorrectly assumed it would skip field recursion for non-actor fields.
1 parent daab566 commit 2fb4b6d

File tree

1 file changed

+6
-6
lines changed
  • test/full-program-tests/codegen-trace-val-to-val-through-trait

1 file changed

+6
-6
lines changed

test/full-program-tests/codegen-trace-val-to-val-through-trait/main.pony

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ actor Main is Receiver
2929

3030
be receive(b: B val) =>
3131
let map_after = @gc_local(this)
32-
// Both sender and receiver trace b as IMMUTABLE (val). Since B has no
33-
// actor fields (might_reference_actor is false), immutable tracing does
34-
// not recurse into fields. So b gets rc bookkeeping but b.a does not
35-
// appear in the object map at all.
32+
// Both sender and receiver trace b as IMMUTABLE (val).
33+
// make_might_reference_actor is currently conservative (always true), so
34+
// immutable tracing recurses into fields just like mutable tracing. Both
35+
// b and b.a get rc bookkeeping.
3636
let ok = @objectmap_has_object_rc(map_before, b, USize(1)) and
37-
not @objectmap_has_object(map_before, b.a) and
37+
@objectmap_has_object_rc(map_before, b.a, USize(1)) and
3838
@objectmap_has_object_rc(map_after, b, USize(0)) and
39-
not @objectmap_has_object(map_after, b.a)
39+
@objectmap_has_object_rc(map_after, b.a, USize(0))
4040
@gc_local_snapshot_destroy(map_before)
4141
@pony_exitcode(I32(if ok then 1 else 0 end))

0 commit comments

Comments
 (0)