Skip to content

Add a convenience initializer that takes a variadic list of elements #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Adlai-Holler
Copy link

Resolves #8 . Unfortunately the compiler can't infer the element type in this case so you have to do ReactiveArray<Int>(1, 2, 3, 4). I'd actually say not to merge this, since manually specifying the type is dumb, but I felt like getting my feet wet with those awesome-looking project!

@@ -98,6 +98,10 @@ public final class ReactiveArray<T>: CollectionType, MutableCollectionType, Debu
self.init(elements: [])
}

public convenience init(_ elements: T...) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the space formatting

@guidomb
Copy link

guidomb commented Sep 14, 2015

Sorry for the delayed response last week has been crazy for me.

I agree that having to specify the type when using the convenience initializer is dumb but it might be fixed in future versions of the compiler.

Could you add a test case for this initializer?

Thanks for contribution!

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.

2 participants