sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Nullable char loses string representation #1005

Open dmirmilshteyn opened 8 years ago

dmirmilshteyn commented 8 years ago

If you try to convert a nullable char to a string, translated javascript outputs the character code # instead.

Here's an example:

using System;

public static class Program {
    public static void Main (string[] args) {
        char? c = 'c';
        Console.WriteLine(c.ToString());

        // Expected: c
        // Actual: 99
    }
}

It also does this for implicit casts:

using System;

public static class Program {
    public static void Main (string[] args) {
        char? c = 'c';
        string ab = "ab";
        ab += c;
        Console.WriteLine(ab);

        // Expected: abc
        // Actual: ab99
    }
}