diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-08-02 23:40:00 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-08-02 23:40:00 +0400 |
commit | 8bcb3c8af21e7bb272476d2868ea133006fe844b (patch) | |
tree | 7713b726cc18ce1b23223b652d9e8003ff7906fb /mcs/tests/test-431.cs | |
parent | bf2bc654037c96e8396ea1414e36967e2041e084 (diff) |
In mcs:
First cut of the qualified-alias-member feature.
* cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
token.
* cs-parser.jay (DOUBLE_COLON): New token.
(namespace_or_type_name): Add rule for recognizing
qualified-alias-members.
(primary_expression): Likewise.
(element_access): Allow QualifiedAliasMember as a possible
type-bearing expression.
(local_variable_type, local_variable_pointer_type): Likewise.
* namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
aliases in the current and enclosing namespace declarations.
(NamespaceEntry.UsingAlias): Add CS0440 warning.
* decl.cs (MemberName.is_double_colon): New.
(MemberName.MemberName): Add new constructor for alias-member.
(MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
* expression.cs (QualifiedAliasMember): New expression type.
In errors:
* cs0431.cs, cs0432.cs, cs0432-2.cs, cs0440.cs, cs0687.cs:
New tests for the qualified-alias-member (::) feature.
In tests:
* test-426.cs, test-427.cs, test-428.cs, test-429.cs,
test-430.cs, test-431.cs, test-432.cs, test-433.cs,
test-434.cs, test-435.cs, test-436.cs: New tests for the
qualified-alias-member (::) feature.
svn path=/trunk/mcs/; revision=47931
Diffstat (limited to 'mcs/tests/test-431.cs')
-rw-r--r-- | mcs/tests/test-431.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mcs/tests/test-431.cs b/mcs/tests/test-431.cs new file mode 100644 index 00000000000..9edd449fea2 --- /dev/null +++ b/mcs/tests/test-431.cs @@ -0,0 +1,13 @@ +using foo = Foo; + +namespace Foo { + class A { } +} + +class X { + static void Main () + { + foo::A a = new Foo.A (); + System.Console.WriteLine (a.GetType ()); + } +} |