www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.typecons.Proxy requires a nothrow destructor and toHash?

reply Saurabh Das <saurabh.das gmail.com> writes:
struct A
{
     import std.stdio;
     File f;
}

struct B
{
     A a;

     import std.typecons;
     mixin Proxy!a;
}

rdmd proxytest.d:
/Library/D/dmd/src/phobos/std/typecons.d(5055): Error: 
'proxytest.A.~this' is not nothrow
/Library/D/dmd/src/phobos/std/typecons.d(5050): Error: function 
'proxytest.B.Proxy!(a).toHash' is nothrow yet may throw
Failed: ["dmd", "-v", "-o-", "proxytest.d", "-I."]

Why doesn't this work? Is it a requirement that a proxied struct 
must have a nothrow destructor and toHash?
Feb 03 2016
parent reply Marc =?UTF-8?B?U2Now7x0eg==?= <schuetzm gmx.net> writes:
On Wednesday, 3 February 2016 at 10:16:56 UTC, Saurabh Das wrote:
 Why doesn't this work? Is it a requirement that a proxied 
 struct must have a nothrow destructor and toHash?
It used to work in 2.066.1; bisecting points to this PR: https://github.com/D-Programming-Language/phobos/pull/3043 When bisecting between 2.066 and 2.067, there are other candidates: https://github.com/D-Programming-Language/phobos/pull/3042 https://github.com/D-Programming-Language/dmd/pull/4459 https://github.com/D-Programming-Language/druntime/pull/1188 Unlikely: https://github.com/D-Programming-Language/phobos/pull/3001 https://github.com/D-Programming-Language/phobos/pull/3043 https://github.com/D-Programming-Language/dmd/pull/4452 https://github.com/D-Programming-Language/dmd/pull/4463 Please file a bug report at: https://issues.dlang.org/enter_bug.cgi
Feb 03 2016
parent Saurabh Das <saurabh.das gmail.com> writes:
On Wednesday, 3 February 2016 at 12:10:01 UTC, Marc Schütz wrote:
 On Wednesday, 3 February 2016 at 10:16:56 UTC, Saurabh Das 
 wrote:
 [...]
It used to work in 2.066.1; bisecting points to this PR: https://github.com/D-Programming-Language/phobos/pull/3043 When bisecting between 2.066 and 2.067, there are other candidates: https://github.com/D-Programming-Language/phobos/pull/3042 https://github.com/D-Programming-Language/dmd/pull/4459 https://github.com/D-Programming-Language/druntime/pull/1188 Unlikely: https://github.com/D-Programming-Language/phobos/pull/3001 https://github.com/D-Programming-Language/phobos/pull/3043 https://github.com/D-Programming-Language/dmd/pull/4452 https://github.com/D-Programming-Language/dmd/pull/4463 Please file a bug report at: https://issues.dlang.org/enter_bug.cgi
Oh, okay. Thanks! Bug report filed: https://issues.dlang.org/show_bug.cgi?id=15641
Feb 03 2016