On 09/17/2010 03:22 PM, dsimcha wrote:
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)) );
}
My bad. However, old code used to work with 2.048, with hasLocalAliasing.
Now the next problem. I do not think there is unshared aliasing here:
----
import std.traits;
struct Foo
{
void function() func;
}
void main()
{
static assert( ! hasUnsharedAliasing!Foo, "struct Foo has unshared
aliasing" );
}
----
but it fails to compile. As far as I understand, functions (unlike
delegates) do not have any shared aliasing but hasUnsharedAliasing
thinks they do.