[Issue 22619] New: [REG2.098.1] Nullable regression introduced by new copy ctor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 21 17:12:42 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22619
Issue ID: 22619
Summary: [REG2.098.1] Nullable regression introduced by new
copy ctor
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: kinke at gmx.net
This newly fails to compile with DMD v2.098.1, but works with 2.098.0:
```
import std.typecons : Nullable, nullable;
struct Module {
Nullable!string name;
}
Nullable!(const(Module)) findModule(const ref Module mod) {
return nullable(mod);
}
```
Error:
```
std/typecons.d(3100): Error: variable
`std.typecons.nullable!(const(Module)).nullable.__copytmp15` `inout` variables
can only be declared inside `inout` functions
bug.d(8): Error: template instance `std.typecons.nullable!(const(Module))`
error instantiating
```
The copy ctor was added in https://github.com/dlang/phobos/pull/8318.
--
More information about the Digitalmars-d-bugs
mailing list