How to actually create a delegate in Alpha4?

Max Ivanchenko 3 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 3

Just testing Alpha4 - and can't create or store delegate variable like 

public event Action<string> myEvent;

if I do like this:

It works somehow in play mode! (the result is "One + two"), but if I generate code I see the error: error CS0815: Cannot assign lambda expression to an implicitly-typed variable

using just Assign node doesn't help too...

How can I score an Action in variable and use it later?

Or maybe I misunderstand delegates? sorry, but it will be nice to see examples in bolt!


Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Bolt 2
Working on Fix

Hi Max, thanks for the report!

I see, the issue is that var setVariable doesn't use the explicit delegate type. It should be Action<string> setVariable instead. I'll have that fixed in the next alpha.

Fixed in Alpha

Fixed for Alpha 5.