Deferred code that is in a scope that is cancelled by race won't run if the expression after defer is an ongoing race.

Summary

Deferred code that is in a scope that is cancelled by race won’t run if the expression after defer is an ongoing race.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

  1. Create a new verse device and paste this code in the OnBegin function
race:
    block:
        defer:
            Print("Deferred print")
        race:
            Sleep(Inf)
            Sleep(Inf)
    block:
        Sleep(3.0)

Expected Result

“Deferred print” should show in the output log when the race finishes.

Observed Result

“Deferred print” does not show in the output log when the race finishes.

Platform(s)

Windows 11

Island Code

2834-1467-3997

FORT-832626 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.

1 Like