task(t:type).Await() crashing in some cases.

Summary

the following snippet will crash 100% of the time.


foo <public> := class{ I : int = 0 }
   

tester_component <public> := class<final_super>(component):
    
    FooEvent : event(foo) = event(foo){}
   
    OnSimulate<override>()<suspends>:void=
    
        Temp : foo = foo{}

        EventTask : task(foo) = spawn{ FooEvent.Await() }

        branch:
            Sleep(1.0)
            FooEvent.Signal( Temp ) # <- causes crash but compiles fine. 

        Foo := EventTask.Await() 


### a temp workaround ###

<#

    This seems to work just fine from what I can tell. 

#>

awaitable_task_wrapper<internal>(t:type) := class<internal>:
    Awaitable <public> : awaitable(t)
    AwaitValue<internal>()<suspends>:t=(Awaitable.Await())

(Awaitable:awaitable(t) where t:type).Task<public>():task(t)=
    Wrapper := awaitable_task_wrapper(t){ Awaitable := Awaitable }
    spawn:
        Wrapper.AwaitValue()

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Stability

Steps to Reproduce

copy snippet, compile, place component on an entity, launch edit session.

Expected Result

EventTask’s Await() to not crash when the event is signaled.

Observed Result

crashing.

Platform(s)

windows

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