D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4740 - core.thread.atomicOp too strict about types
Summary: core.thread.atomicOp too strict about types
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Sean Kelly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 12:10 UTC by David Simcha
Modified: 2011-08-12 20:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2010-08-27 12:10:35 UTC
The following code should really work:

import core.atomic;

void main() {
    uint num;
    atomicOp!"+="(num, 1U);  // Works
    atomicOp!"+="(num, 1);  // Doesn't work because 1 is an int, not a uint.
}
Comment 1 David Simcha 2011-08-12 20:35:58 UTC
This was apparently fixed at some point a while back, because it works in 2.054.