September 09, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #15 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Mike Franklin from comment #14)
> Reopening. The original issue still remains.

Please pare the example code down to the minimum. In fact, the original issue was fixed. If there is another issue, please leave this one closed, and open a new issue for the other issue.

I.e. one issue == one fix

--
September 09, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #16 from Mike Franklin <slavo5150@yahoo.com> ---
(In reply to Walter Bright from comment #15)
> Please pare the example code down to the minimum.

This is the most minimal example I know how to make to illustrate the issue:

---
@safe:

struct ScopeBuffer
{
    this(char[4] init)
    {
        this.buf = init;
    }

    inout(char)[] opSlice(size_t lower, size_t upper) inout
    {
        return buf[lower .. upper];
    }

    char[4] buf;
}

char[] fun()
{
    char[4] buf = "abcd";
    auto sb = ScopeBuffer(buf);
    return sb[0..2];
}

void main()
{
    auto s = fun();
}
---


> In fact, the original
> issue was fixed. If there is another issue, please leave this one closed,
> and open a new issue for the other issue.
> 
> I.e. one issue == one fix

The example above is the original issue and is related to how `inout` infers `return`.

The issue you added was a new, unrelated, issue related to how constructors are checked for scope issues.  I fixed that issue in https://github.com/dlang/dmd/pull/10402.

If we wanted one issue == one fix, we should have made a new issue for the check on constructors, but we're past that now.

The original issue remains, and I've submitted a fix to https://github.com/dlang/dmd/pull/10390

--
September 09, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[DIP1000] temp returned     |[DIP1000] Local data
                   |from constructor call not   |escapes `inout` method if
                   |checked for scope problems  |not decorated with `return`

--
September 20, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #17 from Dlang Bot <dlang-bot@dlang.rocks> ---
@rainers updated dlang/druntime pull request #2805 "fix Issue 20227 - "Error: phread_mutex_destroy failed." after fork()" mentioning this issue:

- Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

- Merge pull request #2785 from JinShil/fix_20149

  Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

https://github.com/dlang/druntime/pull/2805

--
September 21, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=20156

--
September 27, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #18 from Dlang Bot <dlang-bot@dlang.rocks> ---
@rainers updated dlang/druntime pull request #2802 "Issue 20219 - Idle D programs keep consuming CPU in Gcx.scanBackground" mentioning this issue:

- Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

- Merge pull request #2785 from JinShil/fix_20149

  Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

https://github.com/dlang/druntime/pull/2802

--
October 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #19 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ikod updated dlang/druntime pull request #2811 "fix issue 20256" mentioning this issue:

- Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

- Merge pull request #2785 from JinShil/fix_20149

  Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

https://github.com/dlang/druntime/pull/2811

--
October 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #20 from Dlang Bot <dlang-bot@dlang.rocks> ---
@MartinNowak created dlang/dmd pull request #10447 "Merge remote-tracking branch 'upstream/stable' into merge_stable" fixing this issue:

- Fix Issue 20149 - [DIP1000] temp returned from constructor call not checked for scope problems

- Merge pull request #10402 from JinShil/fix_20149_2

  Fix Issue 20149 - [DIP1000] temp returned from constructor call not checked
for scope problems

https://github.com/dlang/dmd/pull/10447

--
October 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #21 from Dlang Bot <dlang-bot@dlang.rocks> ---
@MartinNowak updated dlang/druntime pull request #2758 "Merge remote-tracking branch 'upstream/stable' into merge_stable" mentioning this issue:

- Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

- Merge pull request #2785 from JinShil/fix_20149

  Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

https://github.com/dlang/druntime/pull/2758

--
March 15, 2020
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #22 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Mike Franklin from comment #16)
> (In reply to Walter Bright from comment #15)
> > Please pare the example code down to the minimum.
> 
> This is the most minimal example I know how to make to illustrate the issue:

Thank you. But:

1. how are you compiling it?
2. what do you expect to happen compared with what does happen?
(I compile it and no errors are emitted)

--