[Issue 23933] auto return type disables DIP1000 scope check

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 24 19:13:24 UTC 2023


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

Richard Cattermole <alphaglosined at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alphaglosined at gmail.com
         Resolution|---                         |INVALID

--- Comment #4 from Richard Cattermole <alphaglosined at gmail.com> ---
The inference can be seen when you use auto instead of scope inside of
safeUsage when you output the AST.

```d
struct Struct
{
        int* p;
        @safe void hmm(int i)
        {
        }
}
```

vs with scope & auto:

```d
struct Struct
{
        int* p;
        auto pure nothrow @nogc @safe void hmm(int i)
        {
        }
}
```

I don't see a bug here. This looks to be working correctly. A method that was
not annotated with scope, used with scope, works when inference is turned on.
So I'm closing.

--


More information about the Digitalmars-d-bugs mailing list