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

          Issue ID: 22667
           Summary: Nullable of struct containing unrelated Nullable
                    errors with "inout can only be declared inside inout
                    function"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

Consider the following code:

import std.typecons;

struct Struct
{
    Nullable!int ni;
}

void main()
{
    Struct a = Struct.init;
    Nullable!Struct b = Nullable!Struct(a);
}

test.d(6): Error: variable `test.main.__copytmp756` `inout` variables can only
be declared inside `inout` functions

--

Reply via email to