Bug 22819 – -preview=in rejects typesafe variadic function

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-23T11:16:38Z
Last change time
2024-12-13T19:21:11Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Stanislav Blinov
Moved to GitHub: dmd#18086 →

Comments

Comment #0 by stanislav.blinov — 2022-02-23T11:16:38Z
void foo(in int[3] a...) {} void bar(scope const int[3] a...) {} void car(in int[3] x) {} void main() { // Both lines compile without -preview=in foo(1, 2, 3); // this line fails with -preview=in (cannot pass rvalue argument `1` of type `int` to parameter `in int[3] a...`) bar(1, 2, 3); // but this one compiles in both cases car([1, 2, 3]); // so does this }
Comment #1 by stanislav.blinov — 2022-02-23T11:17:20Z
Should be "the three lines", not "both lines".
Comment #2 by robert.schadek — 2024-12-13T19:21:11Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18086 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB