Bug 22511 – Nullable is not copyable when templated type has elaborate copy ctor

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-11-14T14:17:48Z
Last change time
2022-10-24T18:07:41Z
Keywords
pull
Assigned to
No Owner
Creator
omerfirmak

Comments

Comment #0 by omerfirmak — 2021-11-14T14:17:48Z
import std; struct S { int b; this (int b) { this.b = b; } @disable this(this); this (scope ref inout S) inout { this.b = b; } } void main() { Nullable!S _s; _s = S(3); } ----------------- fails with /home/omer/dlang/ldc-1.28.0/bin/../import/std/typecons.d(3031): Error: Generating an `inout` copy constructor for `struct std.typecons.Nullable!(S).Nullable` failed, therefore instances of it are uncopyable newtest.d(22): Error: template instance `std.typecons.Nullable!(S).Nullable.opAssign!()` error instantiating
Comment #1 by dlang-bot — 2021-11-14T14:39:56Z
@omerfirmak created dlang/phobos pull request #8316 "Fix Issue 22511 - Add explicit copy ctor for Nullable" fixing this issue: - Fix Issue 22511 - Add explicit copy ctor for Nullable https://github.com/dlang/phobos/pull/8316
Comment #2 by dlang-bot — 2021-11-15T08:35:54Z
@omerfirmak created dlang/phobos pull request #8318 "Merge PR #8315 & #8316 in to `stable`" fixing this issue: - Fix Issue 22511 - Add explicit copy ctor for Nullable https://github.com/dlang/phobos/pull/8318
Comment #3 by dlang-bot — 2021-11-15T09:13:54Z
dlang/phobos pull request #8316 "Fix Issue 22511 - Add explicit copy ctor for Nullable" was merged into master: - b141ae469baf5b496ace0e056893b48c371efc72 by Ömer Faruk IRMAK: Fix Issue 22511 - Add explicit copy ctor for Nullable https://github.com/dlang/phobos/pull/8316
Comment #4 by dlang-bot — 2021-11-15T09:20:13Z
dlang/phobos pull request #8318 "Merge PR #8315 & #8316 in to `stable`" was merged into stable: - e84de9faaefc55d09e9f126615e97cf5a219d2c2 by Ömer Faruk IRMAK: Fix Issue 22511 - Add explicit copy ctor for Nullable https://github.com/dlang/phobos/pull/8318
Comment #5 by pro.mathias.lang — 2022-10-24T18:07:41Z
*** Issue 21397 has been marked as a duplicate of this issue. ***