September 19 [Issue 24771] New: apply qualifiers between `ref` and function name to return type | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24771 Issue ID: 24771 Summary: apply qualifiers between `ref` and function name to return type Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: qs.il.paperinik@gmail.com ```d struct S { int[] x; ref const int[] f() => x; } ``` In the above snipped, `const` applies to the implicit `this` parameter of `f`. While prefix type qualifiers are widespread, qualifiers between `ref` and the basic type part of the return type are probably unlikely in both human written and generated code. Maybe we could interpret this the same as `ref const(int[])` instead. -- |
Copyright © 1999-2021 by the D Language Foundation