Skip to content
This repository has been archived by the owner on Mar 29, 2018. It is now read-only.

Array.indexOf not working with [UInt] #21

Closed
ciathyza opened this issue Jul 26, 2014 · 2 comments
Closed

Array.indexOf not working with [UInt] #21

ciathyza opened this issue Jul 26, 2014 · 2 comments

Comments

@ciathyza
Copy link

Your Array.indexOf doesn't work with array of type UInt, in which case it will always return nil.

@pNre
Copy link
Owner

pNre commented Jul 28, 2014

That's because the first parameter of indexOf has to be explicitly declared as UInt (i.e.: array.indexOf(UInt(1))) otherwise the compiler assumes it is an Int.

@ciathyza
Copy link
Author

ahaa! thanks for the hint!

@pNre pNre closed this as completed Jul 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants