Bug 322011 (MONO79302) - [GMCS] No access to internal members with generic classes
Summary: [GMCS] No access to internal members with generic classes
Status: RESOLVED FIXED
Alias: MONO79302
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-06 21:46 UTC by Karl Waclawek
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:08:59 UTC


---- Reported by karl@waclawek.net 2006-09-06 14:46:17 MST ----

Description of Problem:
Under certain scenarios with generic classes, "internal" member access
from the same assembly causes a compile error in gmcs 1.1.17.1. This does
not happen with MS C# 2.0.


Steps to reproduce the problem - this file compiles in MS C# 2.0:

<file>
using System;

namespace test
{

  public class App
  {
    public static void Main() {
    
    }
  }

  public class ThisClass<T, O>
    where T: ThisClass<T, O>
    where O: OtherClass<O, T>
  {
    internal int dummy;
  }

  public class OtherClass<O, T>
    where O: OtherClass<O, T> 
    where T: ThisClass<T, O>
  {
    public void Test(T tc) {
      tc.dummy = 0;
    }
  }
}
</file>


Actual Results: 
test.cs(25,7): error CS0122: `test.ThisClass<T,O>.dummy' is inaccessible
due to its protection level
test.cs(17,18):: `test.ThisClass<T,O>.dummy', name of symbol related to
previous error


Expected Results:
No error.


How often does this happen? 
Always.



---- Additional Comments From karl@waclawek.net 2007-02-14 12:40:07 MST ----

This problem still exists in Mono 1.2.3. One of several problems
preventing me from building (and running) Berkeley DB for .NET on Mono.



---- Additional Comments From martin@ximian.com 2007-03-14 16:22:32 MST ----

Note for myself: Fixed on rohan in the asgard tree.  Will commit
tomorrow morning.



---- Additional Comments From martin@ximian.com 2007-03-15 09:34:51 MST ----

Fixed in SVN; added gtest-314.


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Fedora Core 4</cf_op_sys_details>