[Mono-list] mcs bug

Martin Baulig martin@gnome.org
04 Oct 2002 16:32:08 +0200


Thanks for your bug report, I'll fix it as soon as possible.

Martin

Martin Aliger <martin_aliger@email.cz> writes:

> Hi all,
> 
> while my attempt to isolate bug in NAnt to send it to nant developers, I found another bug in mcs. It is not serious, but should be fixed.
> 
> It seems, that mcs assumes public visibility to contructors as default, rather than private as MS csc does. There is code to reproduce this:
> 
> -------
> using System;
> 
> class Element
> {
> 	string _name="";
> 	public String Name {get{return _name;}}
> 
> 	Element(string s) //should be public
> 	{
> 		_name=s;
> 	}
> }
> 
> class ElTest
> {
> 	private Element _d=new Element("derived");
> 	public Element El {get{return _d;}}
> 
> 	static public void Main()
> 	{
> 		ElTest t=new ElTest();
> 		Console.WriteLine(t.El.Name);
> 	}
> 
> }
> 
> -------
> 
> CSC throws error:
> ell.cs(21,21): error CS0122: 'Element.Element(string)' is inaccessible due to its protection level
> 
> MCS compiles successfully and resulting code works :-)
> 
> Martin Aliger
> 
> 
> ______________________________________________________________________________
> Domácí spotřebiče a elektronika za akční ceny – slevy až 50 %. 
> Klikněte na: http://www.obchodni-dum.cz/index.phtml?prov=54&akce=yes
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 

-- 
Martin Baulig
martin@gnome.org