ldc executable crashes with this code

forkit forkit at gmail.com
Wed Feb 2 23:21:52 UTC 2022


Any reason why compiling this with ldc would cause the exe to 
crash?

Compiling with DMD (using either declaration of palindrome works 
just fine though)


// ----

module test;

import std;

void main()
{
     char[] palindrome = cast(char[])"able was I ere I saw elba";

    //char[] palindrome = 
['a','b','l','e','w','a','s','I','e','r','e','I','s','a','w','e','l','b','a'];

     writeln(palindrome);

     // note: The line below causes the exe to crash when compiled 
with ldc
     // but only if using the first version of palindrome.

     writeln(palindrome.reverse);
}

// ---


More information about the Digitalmars-d-learn mailing list