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

Make the native Int64 class an extension type #118

Open
osa1 opened this issue Oct 18, 2023 · 3 comments
Open

Make the native Int64 class an extension type #118

osa1 opened this issue Oct 18, 2023 · 3 comments

Comments

@osa1
Copy link
Member

osa1 commented Oct 18, 2023

In #117 we make Int64 class a wrapper around int on platforms that support 64-bit ints (VM, AOT, Wasm).

With extension classes we should also make the new wrapper class an extension class to eliminate the indirection to the actual int value.

This will be a breaking change as this new native Int64 extension class won't have a runtime type.

@rakudrama
Copy link
Member

I don't think this will work as Int64 values are put in collections with objects of other types, e.g. the list of field values in a protobuf.

@osa1
Copy link
Member Author

osa1 commented Oct 19, 2023

My understanding is you can pass extension types as generic arguments just fine. If you have a List<Int64>, the runtime type will be List<int> on the platforms where Int64 is an extension type, List<Int64> on others.

@rakudrama
Copy link
Member

My understanding is you can pass extension types as generic arguments just fine. If you have a List<Int64>, the runtime type will be List<int> on the platforms where Int64 is an extension type, List<Int64> on others.

This is true, but _FieldSet.values is a List<dynamic>.

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