Bug 10152 – Refused uint array concat with compatible array literal

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-05-23T09:57:00Z
Last change time
2013-11-21T07:36:31Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-05-23T09:57:11Z
This program shows a dis-uniformity that maybe should be removed: void main() { void main() { uint[] a; a ~= 0; // OK. a ~= [0]; // OK. a ~= [-1]; // OK(?) auto b1 = a ~ 0; // OK. auto b2 = a ~ [0]; // Error. } DMD 2.063beta5 gives: test.d(7): Error: incompatible types for ((a) ~ ([0])): 'uint[]' and 'int[]'
Comment #1 by yebblies — 2013-11-21T07:36:31Z
*** This issue has been marked as a duplicate of issue 10476 ***