GNOME Bugzilla – Bug 605157
Arrays of types doesnt support 'in' operator
Last modified: 2010-03-26 19:20:47 UTC
The 'in' operator does not works for arrays of basic types like int, string, etc.. it can be implemented as in lists with a comparator function: Here's a sample code that fails to compile: (aka test case) --- void main () { int[] foo = { 1, 3, 4, 10 }; if (3 in foo) { print ("integer found\n"); } string[] bar = { "foo", "bar", "cow" }; if ("foo" in bar) { print ("string found\n"); } } ---
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of bug 602511 ***