Bug 322071 (MONO79362) - [GMCS] Cannot access protected members of base class from the constructor
Summary: [GMCS] Cannot access protected members of base class from the constructor
Status: RESOLVED FIXED
Alias: MONO79362
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-11 22:28 UTC by Jan Oravec
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:09:38 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".