Bugzilla – Bug 322071
[GMCS] Cannot access protected members of base class from the constructor
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by jan.oravec@6com.sk 2006-09-11 15:28:05 MST ---- Compilation of the following code: class A<T> { protected A () { } protected int Foo { get { return 47; } } } class B<T> : A<T> { public B () : base () { System.Console.WriteLine (this.Foo); } } Fails with: b.cs(21,31): error CS1540: Cannot access protected member `A<T>.Foo' via a qualifier of type `B<T>'; the qualifier must be of type `B<T>' (or derived from it) The error message is obviously non-sense. Similar non-generic code is compilable. Also, changing 'protected int Foo' to 'public int Foo' helps to compile the code. ---- Additional Comments From martin@ximian.com 2006-09-18 19:43:12 MST ---- Setting priority to a sane value and stealing the bug. ---- Additional Comments From martin@ximian.com 2006-09-18 21:28:22 MST ---- Fixed in SVN. Unknown operating system unknown. Setting to default OS "Other".