Bug 2911 – Odd anomaly of implicit conversions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-04-29T14:37:00Z
Last change time
2015-06-09T01:20:25Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-04-29T14:37:21Z
void main() { char a; wchar c; a = c; const wchar c1; a = c1; } The first conversion makes it, the second doesn't. Either both should succeed or both should fail. Obviously, the right choice is to make both fail. This completely messes some generic code I'm trying to write. I need to special case not only around the bug, but also around the bug in the bug.
Comment #1 by yebblies — 2011-06-12T14:09:40Z
Both statements currently error (dmd 2.053) testx.d(4): Error: cannot implicitly convert expression (c) of type wchar to char testx.d(6): Error: cannot implicitly convert expression ('\U0000ffff') of type const(wchar) to char