www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23640] New: Nullable range iteration doesn't work with

https://issues.dlang.org/show_bug.cgi?id=23640

          Issue ID: 23640
           Summary: Nullable range iteration doesn't work with immutable
                    values
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

import std;

immutable struct S {
    int[] a;
}
void main() {
    Nullable!S a = Nullable!S(S([3].idup));
    writefln!"%s"(a.array);
}

Expected: [S([3])]
Got: Error: none of the overloads of template `std.array.array` are callable
using argument types `!()(Nullable!(immutable(S)))`

--
Jan 18 2023