Bug 10454 – Hex string generates an Outside Unicode code space error
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-23T13:07:50Z
Last change time
2018-10-19T05:53:57Z
Keywords
diagnostic, rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-06-23T13:07:50Z
void main() {
enum s = x"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
pragma(msg, typeof(s));
pragma(msg, s.length);
immutable(char)[16] u16 = x"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
}
DMD 2.064alpha gives:
string
16u
test1.d(5): Error: Outside Unicode code space
So 's' is a immutable(char)[] of 16 chars, but that syntax is refused for 'u16'.
Additionally the error message is wrong, according to what's written in the D documentation:
http://dlang.org/lex.html#HexStringChars
>The hex data need not form valid UTF characters.<
See also Issue 10453
Comment #1 by bearophile_hugs — 2014-01-22T16:46:01Z