DerivcoIpswich / dsharp

A fork of the Script# project.
http://www.derivco.co.uk
Other
20 stars 13 forks source link

Calling `operator+` over `string` and `char` errors: Missing compiler required member System.String.Concat #249

Open isc30 opened 4 years ago

isc30 commented 4 years ago

For some reason, when using operator+ from string type like the following:

return "" + str[0];

the compiler complains:

missing compiler required member System.String.Concat

but when using this it all works fine:

return "" + "b";

I suspect this is due to DSharp not supporting implicit conversion between char and string for this case

isc30 commented 4 years ago

JS does not support char type and it returns a string when you do str[0], so we could define extern operator+ in dsharp for both string and char and it will work out of the box.

Maybe since we are already here, define Concat member function too that calls the static one.