Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Nullable char loses string representation #1005

Open
dmirmilshteyn opened this issue Jul 16, 2016 · 0 comments
Open

Nullable char loses string representation #1005

dmirmilshteyn opened this issue Jul 16, 2016 · 0 comments

Comments

@dmirmilshteyn
Copy link
Contributor

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
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant