Common type of ubyte and const ubyte is int

Steven Schveighoffer schveiguy at gmail.com
Tue Apr 30 18:19:28 UTC 2024


```d
ubyte a;
const(ubyte) b;

auto x = true ? a : b;

pragma(msg, typeof(x)); // int
```

Why? This isn't a VRP problem, as both are `ubyte`.

Related issue

https://issues.dlang.org/show_bug.cgi?id=19817

-Steve


More information about the Digitalmars-d mailing list