[Issue 19838] New: RefCounted fails

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 30 12:03:43 UTC 2019


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

          Issue ID: 19838
           Summary: RefCounted fails
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: marcioapm at gmail.com

I am getting this error when compiling with DMD 2.085.1.
It works fine with 2.083.1

Unfortunately I was not able to put together a simple test case.


/usr/include/dmd/phobos/std/typecons.d(6236,24): Error: pure function 
std.typecons.RefCounted!(WrappedConnection!(LockedConnection!(Connection!VibeSocket*)),
cast(RefCountedAutoInitialize)1).RefCounted.RefCountedStore.move cannot call
impure function
std.algorithm.mutation.moveEmplace!(WrappedConnection!(LockedConnection!(Connection!VibeSocket*))).moveEmplace


Looking at the code, it seems this commit broke it:
https://github.com/dlang/phobos/commit/c4324f405c6aea75c9c074c42a21b42a2a361d76#diff-4e008aedb3026d4a84f58323e53bf017

RefCountedStore.move() was made pure nothrow, but there is no guarantee that
std.algorithm.moveEmplace will be so, as I suppose it's pureness is infered and
therefore not always true.

--


More information about the Digitalmars-d-bugs mailing list