[Issue 23098] New: array literal to scope inout parameter not allowed in safe code
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon May 9 17:12:55 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23098
Issue ID: 23098
Summary: array literal to scope inout parameter not allowed in
safe code
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
```
@safe:
void f(scope inout(int)[] d) {}
void main()
{
f([10, 20]);
}
```
```
Up to 2.091.1: Success and no output
Since 2.092.1: Failure with output:
Error: cast from `int[2]` to `inout(int)[]` not allowed in safe code
```
Introduced by https://github.com/dlang/dmd/pull/11039
Uncovered by: https://github.com/dlang/dmd/pull/14067
--
More information about the Digitalmars-d-bugs
mailing list