www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8591] New: typecons.RefCounted.refCountedPayload should be nothrow

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591

           Summary: typecons.RefCounted.refCountedPayload should be
                    nothrow
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com



When autoInit == RefCountedAutoInitialize.no, then:

refCountedPayload() (and "alias refCountedPayload this") should be nothrow.

This can be fixed by declaring two different functions in a static if bloc...
but this may break the auto doc?

Fix is in pull request 736
https://github.com/D-Programming-Language/phobos/pull/736

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 26 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com



PDT ---
Marking it as nothrow should be completely unnecessary. The function is
templated. nothrow should be inferred. And having to duplicate the function to
have a nothrow and non-nothrow version is definitely undesirable.


so it wouldn't surprise me in the least if it's not being inferred properly in
this case. Attribute inferrence seems to work _sometimes_, but I have yet to
figure out under what conditions it does. It's _supposed_ to be inferred for
all templated functions, delegates which are explicitly typed, and lambdas, but
it only works in a fraction of those circumstances.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 26 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591




I didn't know that nothrow could be inferred.

Also, I completely agree that duplicating the function is, at best,
un-desirable.

Yet the inference doesn't wor;: However, I am not calling "refCountedPayload"
directly, but the alias "alias refCountedPayload this". Maybe that is the


Anyways, it is preventing me from marking other functions as unconditionally
nothrow.

I think that in the long run, it is better to have a single workaround, which
can be centrally fixed later, rather than having a bunch of functions work
around it, potentially never fixing some of those workaround.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/46244164099ec139dad4282c167ea02caac2ecda
Fixes for issue 8591 (nothrow)

https://github.com/D-Programming-Language/phobos/commit/5272df64b29cc5245193c629a5fc15ab0ef2bcf6


Bug8591

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 02 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591




PDT ---
 I didn't know that nothrow could be inferred.
nothrow, pure, and safe are inferred for templated functions and lambdas: http://dlang.org/function.html#function-attribute-inference -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 02 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8591


Jonathan M Davis <jmdavisProg gmx.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 02 2012