I found another issue, and I think this is more likely to be caused by a bug.
Consider:
extend String
def split(chars as char*) as List<of String>
return ['dummy']
class Foo
def main is shared
print 'a:b'.split(@[c':']) # Prints ['dummy'] <!-- s:( --><img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
When the main method is executed, it seems like the compiler is generating a call to my split(char*) extension method. This is shocking, because there is also a split(char[]) method in String that matches exactly the argument I'm passing.
I've tried to reproduce the problem with a class of my own:
class Foo
def bar(x as int[])
pass
extend Foo
def bar(x as int*)
.bar(List<of int>(x).toArray)
class Baz
def main is shared
Foo().bar(@[1, 2])
However, this seems to works perfectly (i.e., the compiler correctly generates a call to bar(int[]).
To the best of my knowledge there is no easy workaround for this, other than giving my extension method a different name (e.g., split2), but that is not very satisfying.