Skip to content

Commit

Permalink
Fix #71602.
Browse files Browse the repository at this point in the history
* mcs/expression.cs (MemberAccess.DoResolve): Backport fix from HEAD.
* tests/test-338.cs: New test for #71602.

svn path=/branches/mono-1-0/mcs/; revision=39497
  • Loading branch information
harinath committed Jan 25, 2005
1 parent 240f80d commit 96057a1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mcs/mcs/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2005-01-25 Raja R Harinath <rharinath@novell.com>

Fix #71602.
* expression.cs (MemberAccess.DoResolve): Backport fix from HEAD.

2005-01-13 Raja R Harinath <rharinath@novell.com>

Fix test-335.cs (bug #58126).
Expand Down
3 changes: 2 additions & 1 deletion mcs/mcs/expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7124,7 +7124,8 @@ public Expression DoResolve (EmitContext ec, Expression right_side, ResolveFlags
return null;

if (member_lookup is TypeExpr) {
if (!(expr is TypeExpr) && !(expr is SimpleName)) {
if (!(expr is TypeExpr) && !(expr is SimpleName) &&
!IdenticalNameAndTypeName (ec, original, expr, loc)) {
Error (572, "Can't reference type `" + Identifier + "' through an expression; try `" +
member_lookup.Type + "' instead");
return null;
Expand Down
4 changes: 4 additions & 0 deletions mcs/tests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2005-01-25 Raja R Harinath <rharinath@novell.com>

* test-338.cs: New test for #71602.

2005-01-13 Raja R Harinath <rharinath@novell.com>

* Makefile (TEST_SOURCES): Add test-335.cs from HEAD.
Expand Down
2 changes: 1 addition & 1 deletion mcs/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST_SOURCES = \
test-271 test-272 test-273 test-274 test-275 test-276 test-277 test-280 \
test-283 test-284 test-290 \
test-292 \
test-335 \
test-335 test-338 \
cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10 \
cls-test-11 cls-test-14 cls-test-15 cls-test-16

Expand Down
14 changes: 14 additions & 0 deletions mcs/tests/test-338.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class X {
public static void Main() { }

Y Y;

static object z = Y.Z.I;
static Y.Z fz () {return Y.Z.I; }
}

public class Y {
public class Z {
public readonly static Z I = new Z ();
}
}

0 comments on commit 96057a1

Please sign in to comment.