Bug 22667 – Nullable of struct containing unrelated Nullable errors with "inout can only be declared inside inout function"

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-01-12T12:14:25Z
Last change time
2022-01-12T22:41:36Z
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2022-01-12T12:14:25Z
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
Comment #1 by kinke — 2022-01-12T13:54:29Z
*** This issue has been marked as a duplicate of issue 22619 ***
Comment #2 by kinke — 2022-01-12T13:55:28Z
[This works now in stable again, as long as T - int in this case - doesn't have a copy ctor.]
Comment #3 by default_357-line — 2022-01-12T16:41:54Z
Oh I see, this fix was not merged into master?
Comment #4 by kinke — 2022-01-12T22:41:36Z
(In reply to FeepingCreature from comment #3) > Oh I see, this fix was not merged into master? Likely; important uncontroversial fixes go to stable first and do make it to master at some point.