On Friday, 26 April 2013 at 18:22:10 UTC, Walter Bright wrote:
On 4/26/2013 6:51 AM, deadalnix wrote:
The last time I experienced that feature was with a char getting casted to bool implicitly and then appended to a string, causing super weird behavior after
when using the resulting (corrupted) string.


void main()
{
    bool b = 'c';
}

dmd -c foo
foo.d(4): Error: cannot implicitly convert expression ('c') of type char to bool
import std.stdio;

void main()
{
        bool c0 = '\1'; //compiled OK
        bool c1 = '\0'; //compiled OK
        
        writeln(c0,' ',c1); //output: true false
}

Reply via email to