[Issue 15782] [Reg 2.071-devel] something about the const/non-const types in TypeTuples changed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Mar 16 09:41:39 PDT 2016


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

--- Comment #6 from Martin Nowak <code at dawg.eu> ---
(In reply to John Colvin from comment #5)
> Apologies for not noticing the changes, I didn't notice the bug in the old
> implementation.

No problem, it took me 20 minutes to find the change (b/c it's more or less a
compiler bug, see issue 11480).

> What is the way forward here? The old behaviour was unexpected (why remove
> qualifiers?), inconsistent (didn't happen for builtins) and undocumented. I
> would argue that it's a straightforward bug and we should just say it's now
> fixed, perhaps adding a warning and a special changelog entry.

But it's been like that since ages and might now subtly break metagen code
(e.g. serialization frameworks). The amount of time necessary to debug that
some binary protocol no longer works b/c the semantics of Replace were fixed
justifies that we put some more effort into this.

I'd try sth. along this line, though it might raise too many errors.
----
deprecated("message about Alias")
template Alias(T) if (isAffected!T && !is(T == Unqual!T))
{
    alias Alias = Unqual!T;
}

template Alias(T) if (!isAffected!T || is(T == Unqual!T))
{
    alias Alias = T;
}
----

--


More information about the Digitalmars-d-bugs mailing list