diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-05-30 14:38:32 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-05-30 14:38:32 +0400 |
commit | 5cc74c7d75c10033fa91695b70695a48f05bb98c (patch) | |
tree | d047b7fdf58e977feb9a68c4cb81de25893d8c19 /mcs/errors/cs0122-16.cs | |
parent | b1e6805b9cd3f3ce9e581127eb738350e992822e (diff) |
In mcs:
Fix #75088.
* ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
the "almostMatchedMember" case too.
* typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
that failed the accessibility checks to 'almost_match'.
In errors:
* cs0122-16.cs: New test from #75088.
svn path=/trunk/mcs/; revision=45190
Diffstat (limited to 'mcs/errors/cs0122-16.cs')
-rw-r--r-- | mcs/errors/cs0122-16.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mcs/errors/cs0122-16.cs b/mcs/errors/cs0122-16.cs new file mode 100644 index 00000000000..08c9905d952 --- /dev/null +++ b/mcs/errors/cs0122-16.cs @@ -0,0 +1,21 @@ +// cs0122-16.cs: 'A.x' is inaccessible due to its protection level +// Line: 16 + +public class A +{ + protected bool x = true; + + public A() + {} +} + +public class B +{ + public static void Main(string[] args) + { + if (new A().x) + { + System.Console.WriteLine("this should not compile"); + } + } +} |