dmd 1.064 and 2.049 release

dsimcha dsimcha at yahoo.com
Fri Sep 17 13:22:21 PDT 2010


== Quote from osa (osa at aso.osa)'s article
> After upgrading to 2.049, trying to compile this code:
> ----
> import std.traits;
> void foo() {}
> void main() {
>      static assert( ! hasUnsharedAliasing!foo );
> }
> ----
> gives this error:
> dmd2/linux/bin/../../src/phobos/std/traits.d(971): Error: template
> instance isAssociativeArray!(foo) does not match template declaration
> isAssociativeArray(T)
> dmd2/linux/bin/../../src/phobos/std/traits.d(971): Error: expression
> isAssociativeArray!(foo) is not constant or does not evaluate to a bool
> It used to work with 2.048 so it is probably caused by fixing bug 4834.
> Also, error message points to the guts of std.traits and does not give
> any clue about actual instantiation of hasUnsharedAliasing which caused
> this. It was not easy to reduce the problem to the small test case.

I agree the error message is obtuse, but I don't think this code is supposed to
work because foo is not a type.  This code does work:

import std.traits;
void foo() {}
void main() {
     static assert( ! hasUnsharedAliasing!(typeof(foo)) );
}


More information about the Digitalmars-d-announce mailing list