Comment #0 by bearophile_hugs — 2014-02-06T16:08:47Z
I am not sure, but perhaps this shows an inconsistency worth fixing:
long[] foo() {
return [1]; // OK
}
void main() {
long[] a;
auto b1 = a ~ 0; // OK
auto b2 = a ~ [0]; // Error
auto c1 = 0 ~ a; // OK
auto c2 = [0] ~ a; // Error
}
dmd 2.065beta2 gives:
test.d(7): Error: incompatible types for ((a) ~ ([0])): 'long[]' and 'int[]'
test.d(9): Error: incompatible types for (([0]) ~ (a)): 'int[]' and 'long[]'
Comment #1 by robert.schadek — 2024-12-13T18:16:40Z