[Issue 22901] New: Can't construct inout SumType
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 18 18:54:27 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22901
Issue ID: 22901
Summary: Can't construct inout SumType
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.099.0, the following program fails to compile:
---
import std.sumtype;
inout(SumType!(int[])) example(inout int[] arr)
{
return inout(SumType!(int[]))(arr);
}
---
The error message is:
---
onlineapp.d(5): Error: none of the overloads of `__ctor` are callable using a
`inout` object
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(366): Candidates
are: `std.sumtype.SumType!(int[]).SumType.this(int[] value)`
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(388):
`std.sumtype.SumType!(int[]).SumType.this(const(int[]) value)`
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(405):
`std.sumtype.SumType!(int[]).SumType.this(immutable(int[]) value)`
---
--
More information about the Digitalmars-d-bugs
mailing list