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

Mapping between C# types and NeoVM types #290

Closed
erikzhang opened this issue Jun 12, 2020 · 7 comments · Fixed by #295
Closed

Mapping between C# types and NeoVM types #290

erikzhang opened this issue Jun 12, 2020 · 7 comments · Fixed by #295
Assignees
Labels

Comments

@erikzhang
Copy link
Member

erikzhang commented Jun 12, 2020

Supported types

C# -> NeoVM
null -> Null
bool -> Integer
sbyte -> Integer
byte -> Integer
short -> Integer
ushort -> Integer
int -> Integer
uint -> Integer
long -> Integer
ulong -> Integer
BigInteger -> Integer
byte[] -> Buffer
char -> Integer
string -> ByteString
Array -> Array
Enum -> Integer
class -> Array
struct -> Struct
tuple -> Struct
event -> System.Runtime.Notify()
lambda -> Pointer
Delegate -> Pointer | Callback

Any nullable types will also be mapped to the NeoVM types corresponding to their base types. Because all NeoVM types are nullable.

Unsupported types

float
double
decimal

@erikzhang
Copy link
Member Author

Can someone check the implementation of the compiler according to this table?

@shargon
Copy link
Member

shargon commented Jun 12, 2020

I will create a unit test in dev-pack for ensure this behaviour

@shargon shargon self-assigned this Jun 12, 2020
@shargon
Copy link
Member

shargon commented Jun 13, 2020

event -> System.Runtime.Notify()

We should specify that the arguments are Array with the name of the event in the first position

@erikzhang
Copy link
Member Author

Maybe we should add an eventName to Notify().

@shargon
Copy link
Member

shargon commented Jun 13, 2020

Maybe we should add an eventName to Notify().

Yes, I will

@erikzhang
Copy link
Member Author

@shargon neo-project/neo#1701

@lightszero
Copy link
Member

fix it #295

lightszero added a commit that referenced this issue Jun 17, 2020
fixed #290

Co-authored-by: lights li <lightsever@hotmail.com>
Co-authored-by: erikzhang <erik@neo.org>
ProDog pushed a commit to ProDog/neo-devpack-dotnet that referenced this issue Jun 22, 2020
fixed neo-project#290

Co-authored-by: lights li <lightsever@hotmail.com>
Co-authored-by: erikzhang <erik@neo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants