Thread overview
[Issue 17502] Out contract in class method causes dmd segfault.
Jun 14, 2017
drug007
Jun 14, 2017
Ivan Kazmenko
[Issue 17502] [REG2.064] Out contract in class method causes dmd segfault.
Jun 14, 2017
Vladimir Panteleev
Jun 14, 2017
Vladimir Panteleev
June 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

drug007 <drug2004@bk.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[The D Bug Tracker]         |Out contract in class
                   |                            |method causes dmd segfault.

--
June 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

Ivan Kazmenko <gassa@mail.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gassa@mail.ru

--- Comment #1 from Ivan Kazmenko <gassa@mail.ru> ---
Fails with previous releases, to at least 2.064.2.  Between 2.068.2 and 2.069.0 (frontend translated into D), the error diagnostic changes.

The "in {}" line can be dropped, but class, auto return type, and "out" without parameters seem to all be important.

--
June 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com
            Summary|Out contract in class       |[REG2.064] Out contract in
                   |method causes dmd segfault. |class method causes dmd
                   |                            |segfault.
           Severity|normal                      |regression

--- Comment #2 from Vladimir Panteleev <thecybershadow@gmail.com> ---
Introduced in https://github.com/dlang/dmd/pull/2383

--
June 14, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Vladimir Panteleev <thecybershadow@gmail.com> ---
PR by @Burgos:
https://github.com/dlang/dmd/pull/6906

--
June 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/99b7e49ad99ac2cb3e64e053a45e4663271ffae7 Fix issue 17502: Allow no parameters in out contract for auto methods

Even in case of non-void methods, their out contract should
be able to accept no arguments. For the methods with auto return type,
there was oversight where one argument to `out` was always assumed.

https://github.com/dlang/dmd/commit/620acd53b63bfede6179a1b6a5c7d1b01a14ed0e Merge pull request #6906 from Burgos/out_param

Fix issue 17502: Allow no parameters in out contract for auto methods

--
June 15, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
August 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/99b7e49ad99ac2cb3e64e053a45e4663271ffae7 Fix issue 17502: Allow no parameters in out contract for auto methods

https://github.com/dlang/dmd/commit/620acd53b63bfede6179a1b6a5c7d1b01a14ed0e Merge pull request #6906 from Burgos/out_param

--
September 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

--- Comment #6 from github-bugzilla@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/831552d2047d802c0d4b02c72940ddf43fbc360c Fix bug 17502 (again): Generate contracts after inferring return type.

Wait until after the return type has been inferred before generating the contracts for this function, and merging contracts from overrides.

This was originally at the end of the first semantic pass, but required a fix-up to be done here for the '__result' variable type of __ensure() inside auto functions, but this didn't work if the out parameter was implicit.

--
October 01, 2017
https://issues.dlang.org/show_bug.cgi?id=17502

--- Comment #7 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/831552d2047d802c0d4b02c72940ddf43fbc360c Fix bug 17502 (again): Generate contracts after inferring return type.

--