[Issue 13215] New: Error message with static this array assignment
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 27 07:01:41 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13215
Issue ID: 13215
Summary: Error message with static this array assignment
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
import std.algorithm: map;
import std.array: array;
enum uint N = 10;
immutable uint[2][3] arr1 = [1, 2, 3].map!(x => [x, x]).array; // OK.
immutable uint[2][3] arr2;
static this() {
arr2 = [1, 2, 3].map!(x => [x, x]).array;
}
void main() {}
dmd 2.066beta5 gives:
test.d(7,39): Error: cannot implicitly convert expression (array(map([1, 2,
3]))) of type int[][] to immutable(uint)[]
But I expect that code to work, or to give an error message like:
test.d(7,39): Error: cannot implicitly convert expression (array(map([1, 2,
3]))) of type int[][] to immutable(uint)[2][]
--
More information about the Digitalmars-d-bugs
mailing list