Feature suggestion
I find it frustrating that both the left and right sides of a String.concat/+ operator cannot join, for example, string and i32.
In JavaScript, it
- Checks to see if the right side of the binary expression is a
string - If not, it then checks if the right side has a
.toString(): string method - If so, it calls it and concatenates
left+right.toString()
Would be quite simple to implement. For example, this would probably work:
exportclassString{
...
@operator("+")_concat<T>(left: string,right: T): string{if(!isDefined(right.toString()))ERROR(...);returnthis.concat(left,right.toString());}}
Feature suggestion
I find it frustrating that both the left and right sides of a
String.concat/+operator cannot join, for example,stringandi32.In JavaScript, it
string.toString(): stringmethodleft+right.toString()Would be quite simple to implement. For example, this would probably work: