August 12, 2019 [Issue 2788] return val not passable via ref const in other method | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=2788 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |INVALID --- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> --- `getVar()` is an rvalue, therefore it cannot be passed to a ref parameter. Therefore the bug report is invalid. >struct A {} >void foo(ref A a) {} >void main() >{ > foo(A()); >} This doesn't compiler and neither does this: >static A bar() >{ > return A(); >} > >foo(bar()); Closing as invalid. -- |
Copyright © 1999-2021 by the D Language Foundation