boxer-project / boxer-sunrise

Sunrise on the Boxer Reconstruction Project
BSD 3-Clause "New" or "Revised" License
39 stars 2 forks source link

Scoping error on `setheading` when wrapping a Graphics Box in a DoIt Box #76

Open rigdern opened 2 weeks ago

rigdern commented 2 weeks ago

Repro steps

I reproed this with Boxer 3.4.18 2024-05-26 on macOS

  1. Create a Graphics Box. Name it graphics. Name its sprite turtle-sprite.
  2. Outside of the Graphics Box, write a line like this that sets the sprite's heading to a random value: image

Unexpected result: An error is returned:

Error: 
Primitive SETHEADING
Don't have a Sprite to Talk to

Repro file

You can see the bug in this boxer file: scoping demo.box.zip. Here's a screenshot of that file:

image

sgithens commented 2 weeks ago

Huh, this is a pretty interesting issue, thank you for the detailed reproduction, including both working and failing tests. We've had this sort of "not having a sprite issue to talk to" issue pop up here and there and occasionally. I hope this detailed set of test cases should make it relatively easy to track down. Thanks much!