On Tuesday, 12 March 2019 at 05:14:21 UTC, Victor Porton wrote:
Why does this not compile?

import std.typecons;

template FieldInfo(T, Nullable!T default_) {
}

/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(2570,17): Error: `alias 
T = T;` cannot alias itself, use a qualified name to create an overload set
/usr/lib/ldc/x86_64-linux-gnu/include/d/std/typecons.d(3291,17): Error: `alias 
T = T;` cannot alias itself, use a qualified name to create an overload set

It seems to be getting confused between the two types of Nullable, namely:
Nullable(T), and
Nullable(T, T defaultVal)

template FieldInfo(T) {
    template FieldInfo(Nullable!(T) default_)
    {
        enum FieldInfo = 0;
    }
}

seems to work, but I can't seem to instantiate one of it.

Reply via email to