```
void main() {
static assert(is(int:dchar));
int a = 1114112;
dchar b = a;
dchar c = 1114112;
}
```
On variable c it says Error: cannot implicitly convert expression 1114112 of type int to dchar. The value is above `dchar.max`, but since `is(int:dchar)` the error "cannot implicitly convert" is false.
Related: https://issues.dlang.org/show_bug.cgi?id=14627
Comment #1 by dominikus — 2020-01-04T15:40:15Z
dchar is designed to contain unicode values, which are limited to the range 0x00000000 to 0x0010FFFF == 1114111, so the given literal is outside this range.
Comment #2 by robert.schadek — 2024-12-13T19:06:40Z