[Issue 8601] CTFE Assertion failure (interpret.c) on dstring[].toUpper

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 5 00:04:27 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8601



--- Comment #2 from Don <clugdbug at yahoo.com.au> 2012-09-05 00:04:56 PDT ---
The dstring ICE is entirely spurious, the assert is wrong and should be
removed.

The situation with string is a completely unrelated bug; it's a
constant-folding issue. A string initialized with an array literal doesn't
support ~= of a 
character of a larger size. Here's a reduced case for that bug.

bool bug8601b()
{
    string r =  ['x', 'q'];
    dchar c = 'ü';
    r ~= c;
    assert(r == "xqü");
    return true;
}

static assert(bug8601b());

bug.d(8): Error: Cannot interpret r ~= c at compile time

This is interesting because an array literal containing multiple code point
characters cannot normally exist.
--------
void main()
{
  string yyy = ['ü', 'q']; // ok
}
string xxx = ['ü', 'q'];  // fails
--------
g.d(8): Error: cannot implicitly convert expression ('\xfc') of type wchar to
immutable(char)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list