[Issue 17362] New: Don't infer return attribute for explicit scope arguments
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 1 01:46:36 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17362
Issue ID: 17362
Summary: Don't infer return attribute for explicit scope
arguments
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: nick at geany.org
auto f(scope Object i){return i;}
The above compiles with -dip1000 because parameter i is inferred as `return
scope`. As the author deliberately wrote `scope`, the compiler should error
when trying to return a scope parameter. This will help to catch bugs in
complex generic code.
--
More information about the Digitalmars-d-bugs
mailing list