Nesting aliases in C#

According to the standard it looks like the answer is no. From Section 16.3.1, paragraph 6:

1 The order in which using-alias-directives are written has no significance, and resolution of the namespace-or-type-name referenced by a using-alias-directive is not affected by the using-alias-directive itself or by other using-directives in the immediately containing compilation unit or namespace body.

2 In other words, the namespace-or-type-name of a using-alias-directive is resolved as if the immediately containing compilation unit or namespace body had no using-directives.

Edit:

I just noticed that the version at the above link is a bit out of date. The text from the corresponding paragraph in the 4th Edition is more detailed, but still prohibits referencing using aliases within others. It also contains an example that makes this explicit.

Depending on your needs for scoping and strength of typing you might be able to get away with something like:

class Foo : System.Collections.Generic.Queue<Bar>
{
}

Tags:

C#

Alias

Typedef