How do you pass an alias type defined by using
to the generic class?
I tried the following code:
using ID = Int32; // it might be replaced with `String`.
using CC = C<ID>;
public class C<T> {
T id;
}
and there will be an error:
Error CS0246 The type or namespace name 'ID' could not be found (are you missing a using directive or an assembly reference?)
But the using directive is right above the line where the error occurs. Did I miss something?
ID
in the outer namespace andCC
in an inner namespace. The fact that they're in the same namespace is the problem here. – Purse