Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Invoke doesn't work using ?.Invoke #1093

Open
shargon opened this issue Jul 30, 2024 · 0 comments
Open

Event Invoke doesn't work using ?.Invoke #1093

shargon opened this issue Jul 30, 2024 · 0 comments
Assignees

Comments

@shargon
Copy link
Member

shargon commented Jul 30, 2024

Is not possible to invoke an event using MyEvent?.Invoke

    public class Contract_Event : SmartContract.Framework.SmartContract
    {
        [DisplayName("transfer")]
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
        public static event Action<byte[], byte[], BigInteger> Transferred;
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

        public static void test()
        {
            Transferred?.Invoke(new byte[] { 1, 2, 3 }, new byte[] { 4, 5, 6 }, 7);
        }

It throw NC2001: Unsupported symbol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants