[Issue 13827] Internal Compiler Error: null field
https://issues.dlang.org/show_bug.cgi?id=13827 Temtaime changed: What|Removed |Added Keywords||ice-on-valid-code --
[Issue 13827] Internal Compiler Error: null field
https://issues.dlang.org/show_bug.cgi?id=13827 --- Comment #4 from Temtaime --- Thanks. It worked in 2.066. :) P.S. +1 for 42 --
[Issue 13827] Internal Compiler Error: null field
https://issues.dlang.org/show_bug.cgi?id=13827 --- Comment #3 from Ketmar Dark --- p.s. i'm not even sure that this is supposed to work in compile-time. --
[Issue 13827] Internal Compiler Error: null field
https://issues.dlang.org/show_bug.cgi?id=13827 Ketmar Dark changed: What|Removed |Added CC||ket...@ketmar.no-ip.org --- Comment #2 from Ketmar Dark --- struct Matrix(T) { private static defaultMatrix() { T arr[3]; return arr; } union { T[3] A = defaultMatrix; T[3] flat; } this (T v) { flat[0] = v; } } enum S = Matrix!int(42); --
[Issue 13827] Internal Compiler Error: null field
https://issues.dlang.org/show_bug.cgi?id=13827 --- Comment #1 from Temtaime --- Reduced more: struct Matrix(T, uint N) { private static defaultMatrix() { T arr[N]; return arr; } union { T[N] A = defaultMatrix; T[N] flat; } this(A...)(auto ref in A args) { uint k; foreach(ref v; args) flat[k++] = cast(T)v; } } enum S = Matrix!(int, 3)(1, 2, 3); --