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

Fix to concat a union of arrays #3775

Closed

Conversation

makenowjust
Copy link
Contributor

It is cannot be compiled:

p [1, 2.0].concat([3] || [4.0])

# can't cast (Pointer(Float64) | Pointer(Int32)) to Pointer(Void)

This pull request fixes it by adding Array#concat_to and Enumerable#concat_to, and forwarding from Array#concat to them.

@asterite
Copy link
Member

Hmm... yes, it should work. But I'd like to solve this without adding new public methods to Enumerable and Array. I'll try to think of a solution...

@makenowjust
Copy link
Contributor Author

@asterite We can use macro to fix it, but it is very dirty and its error message is worse than now.

@asterite asterite closed this in ab4a68e Dec 26, 2016
@asterite
Copy link
Member

@makenowjust I fixed it at the Pointer level :-)

@makenowjust makenowjust deleted the fix/array/concat-type branch December 26, 2016 00:49
@makenowjust
Copy link
Contributor Author

makenowjust commented Dec 26, 2016

@asterite Wow, amazing! I make copy_from_impl and move_from_impl method just now, and I will propose it to you. It's just synchronicity!

@asterite
Copy link
Member

@makenowjust Haha, cool, our minds are in sync! This also happened to me too, in this comment: I was going to ask you to extract a method to increment line numbers, and you did it before me asking it :-P

@makenowjust
Copy link
Contributor Author

@asterite The best thing is only one every time, and we aim to reach the best.

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

Successfully merging this pull request may close these issues.

None yet

2 participants