Summary
Unexpected session crash when running verse code with advanced parametric types, without compiler or runtime errors
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
I am trying to make my own custom event wrapper that suppports custom arguments fully, here is the code:
#Subscribe with custom argument
SubscribeWithArg<public>(Listenable : listenable(arg1), OutFun : tuple(arg1, arg2) -> void, Extra : arg2 where arg1:type, arg2 : type) : cancelable =
Wrapper := with_arg_wrapper(arg1, arg2):
Extra := Extra,
OutFun := OutFun
Listenable.Subscribe(Wrapper.InputFun)
with_arg_wrapper<public>(arg1 : type, arg2 : type) := class<public>:
Extra<public> : arg2
OutFun<public> : tuple(arg1, arg2) -> void
InputFun<public>(Arg1 : arg1) : void = OutFun(Arg1, Extra)
Usage:
SubscribeWithArg(EProp.Button.InteractedWithEvent, OnPurchase, ())
And here is my event wrapper:
PrintAgent<localizes>(a : agent) : message = "Agent: {a}"
OnPurchase(Agent : agent, Data : tuple()) : void =
Print(PrintAgent(Agent))
Expected Result
Im not sure if im using parametric types correctly, but im expecting to get a print with player’s name when i use the button
Note: The one using the button is me, a real player, not a npc, animal etc
Observed Result
My whole verse session crashes, no compile errors, no runtime errors in uefn, just complete session crash without any reasoning
Overall, this custom event wrapper doesnt work, the second argument works perectly fine, but the first argument, e.g. agent, doesn’t, i cannot convert it to a player nor print it
Platform(s)
Windows 11 pro on both uefn and fortnite client
Additional Notes
There aren’t any npcs, animals, test players etc in my map, every action is made by a real player