[Issue 22518] New: [dip1000] return without scope/ref not specified

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 17 23:28:12 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22518

          Issue ID: 22518
           Summary: [dip1000] return without scope/ref not specified
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

I think this should pass:
```
void retsc(return scope int* x);
void ret(return int* x);
static assert(is(typeof(retsc) == typeof(ret)));
```

In the current implementation it doesn't, since `return` adds `scope` with
`STC.scopeinferred` so it's not part of the type's mangle. Since it only
depends on the signature, not any actual function body inference, I think
making this distinction is a needless complication.

I would call this a bug, but since the spec doesn't say anything about `return`
without `scope` or `ref`, I'm filing this as a specification issue.

--


More information about the Digitalmars-d-bugs mailing list