Skip to content

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

@shargon

Description

@shargon

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions