sq / JSIL

CIL to Javascript Compiler

Home Page:http://jsil.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nullable char loses string representation

dmirmilshteyn opened this issue · comments

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
    }
}