Phobos is now compiled with -preview=dip1000

H. S. Teoh hsteoh at quickfur.ath.cx
Fri May 17 18:06:45 UTC 2019


On Thu, May 16, 2019 at 10:35:27AM +0000, Seb via Digitalmars-d-announce wrote:
> On Thursday, 16 May 2019 at 10:03:42 UTC, Kagamin wrote:
> > On Thursday, 16 May 2019 at 05:22:42 UTC, Seb wrote:
> > > Yes that sounds like the culprit. Btw as mentioned on DConf, the
> > > dip1000 switch contains a few other breaking changes which will
> > > make it even harder to adopt too.
> > 
> > Well, it's an inherent property of DIP1000 to not compile code that
> > previously compiled. Though safety of tupleof shouldn't depend on
> > DIP1000.
> 
> Well, here's the full discussion:
> 
> https://github.com/dlang/dmd/pull/8035

Finally got round to skimming through that discussion.

Looks like in this case, what we need is for toHash to be declared
@trusted when .tupleof includes private members (because toHash is not
supposed to modify any private members, and I assume hashing over a
private member shouldn't violate @safe -- right?).

Either that, or RedBlackTree needs to be changed so that @safe-ty
doesn't depend on random user types having private fields breaking
compilation.  It's pretty ridiculous, from a user's POV, for a standard
container to fail to compile just because the user had the audacity to
declare private members in his object! And the fact that this root
problem is masked under a totally obscure compile error only adds salt
to the wound.


T

-- 
IBM = I Blame Microsoft


More information about the Digitalmars-d-announce mailing list