Bug 23098 – array literal to scope inout parameter not allowed in safe code
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-05-09T17:12:55Z
Last change time
2022-05-10T07:12:40Z
Keywords
pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2022-05-09T17:12:55Z
```
@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
Comment #1 by dlang-bot — 2022-05-09T17:15:36Z
@dkorpel created dlang/dmd pull request #14097 "Fix issue 23098 - array literal to scope inout parameter not allowed …" fixing this issue:
- Fix issue 23098 - array literal to scope inout parameter not allowed in safe code
https://github.com/dlang/dmd/pull/14097
Comment #2 by dlang-bot — 2022-05-10T07:12:40Z
dlang/dmd pull request #14097 "Fix issue 23098 - array literal to scope inout parameter not allowed …" was merged into stable:
- 28d6a4a84326ec288d1380ddece0b63cd2c05306 by Dennis Korpel:
Fix issue 23098 - array literal to scope inout parameter not allowed in safe code
https://github.com/dlang/dmd/pull/14097