September 16, 2020 [Issue 21254] New: Terse lambda syntax does not allow specifying ref return type | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21254 Issue ID: 21254 Summary: Terse lambda syntax does not allow specifying ref return type Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: andrej.mitrovich@gmail.com ----- struct S { int val; } auto get = (ref S s) => s.val; // returns rvalue, not usable for our case ref get = (ref S s) => s.val; // Error: variable `test.get` only parameters or `foreach` declarations can be `ref` void main () { S s; s.get() = 10; } ----- -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply