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

demonstrate error type #1085

Closed
wants to merge 2 commits into from
Closed

demonstrate error type #1085

wants to merge 2 commits into from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jul 27, 2024

@shargon this pr demonstrate the problem of compiling nullable type.

methods

    public static void TestBigInteger(BigInteger? a)
    public static void TestInt(int? a)
    public static void TestUInt(uint? a)
    public static void TestLong(long? a)
    public static void TestULong(ulong? a)
    public static void TestShort(short? a)
    public static void TestUShort(ushort? a)
    public static void TestSByte(sbyte? a)
    public static void TestByte(byte? a)
    public static void TestChar(char? a)
    public static void TestBool(bool? a)
    public static void TestUInt160(UInt160? a)
    public static void TestUInt256(UInt256? a)
    public static void TestUInt160Array(UInt160[] a)
    public static void TestUInt256Array(UInt256[] a)
    public static void TestByteArray(byte[] a)
    public static void TestString(string a)
    public static void TestObject(object a)

compiled:

    public abstract void TestBigInteger(IList<object>? a);
    public abstract void TestBool(IList<object>? a);
    public abstract void TestByte(IList<object>? a);
    public abstract void TestByteArray(byte[]? a);
    public abstract void TestChar(IList<object>? a);
    public abstract void TestInt(IList<object>? a);
    public abstract void TestLong(IList<object>? a);
    public abstract void TestObject(object? a = null);
    public abstract void TestSByte(IList<object>? a);
    public abstract void TestShort(IList<object>? a);
    public abstract void TestString(string? a);
    public abstract void TestUInt(IList<object>? a);
    public abstract void TestUInt160(object? a = null);
    public abstract void TestUInt160Array(IList<object>? a);
    public abstract void TestUInt256(object? a = null);
    public abstract void TestUInt256Array(IList<object>? a);
    public abstract void TestULong(IList<object>? a);
    public abstract void TestUShort(IList<object>? a);

@Jim8y Jim8y requested a review from shargon July 27, 2024 10:23
@Jim8y Jim8y mentioned this pull request Jul 27, 2024
@Jim8y Jim8y requested a review from cschuchardt88 July 27, 2024 10:24
@shargon
Copy link
Member

shargon commented Jul 29, 2024

maybe we can adapt neo-project/proposals#160 to add nullable?

@cschuchardt88
Copy link
Member

Just say all types are nullable. nullable in dotnet is just a way for you to be able to make sure you are not reading a null object.

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

Successfully merging this pull request may close these issues.

3 participants