RE: [Ikvm-developers] (no subject)
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2003-07-25 06:58:01
|
Jonathan Pierce wrote: > >System.String doesn't implement CharSequence, so that=20 > wouldn't work (at > >least not until I write the code that makes the compiler pretend that > >System.String implements CharSequence). >=20 > I guess I don't fully understand the issue or perhaps your map > implementation. I would think that you could just map the=20 > call so that ikvmc replaces calls to CharSequence.subSequence > (int beginIndex, int endIndex) > with calls to System.String.SubString (beginIndex, endIndex) I think you understand the map implementation, but what you're missing is that I can't just return a System.String from String.subSequence, because the calling code expects an interface CharSequence. I can't just substitute a string for that because the same code might also want work with other classes that implement CharSequence. BTW, it would be possible for me to implement String.subSequence, by returning an instance of my own helper class that implements CharSequence, but since this is only a partial (and probably useless) solution, I chose not to do that. Regards, Jeroen |