February 07, 2014 [Issue 12091] New: Possible inconsistency in array literals implicit cast | ||||
---|---|---|---|---|
| ||||
https://d.puremagic.com/issues/show_bug.cgi?id=12091 Summary: Possible inconsistency in array literals implicit cast Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2014-02-06 16:08:47 PST --- 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[]' -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation