[Mono-list] mcs nonpublic class bug
John Duncan
jddst19@mac.com
Wed, 11 Sep 2002 16:07:26 -0500
--Apple-Mail-3--215844525
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
When I was playing with the FormatCustom problem, I found that MCS lets
me reference nonpublic classes even in other assemblies. this was a
little bit surprising.
I think this is a bug; it occurs in mcs-0.13. I believe it fails on
current sources too.
--Apple-Mail-3--215844525
Content-Disposition: attachment;
filename=npclasstest.cs
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="npclasstest.cs"
namespace Mcs.Test {
public class Foo {
public Foo() {}
public void doit() {
Bar bar = new Bar();
doitWithBar(bar);
}
void doitWithBar(Bar bar) {}
}
class Bar {}
}
--Apple-Mail-3--215844525
Content-Disposition: attachment;
filename=npclasstest.sh
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="npclasstest.sh"
#!/bin/sh
echo -n "Non-public class test: "
mcs /target:library -o npclasstest.dll npclasstest.cs > /dev/null
mcs /target:exe -o npclasstestmain.exe npclasstestmain.cs -r npclasstest.dll > /dev/null && echo failed || echo passed
rm -f npclasstest.dll npclasstestmain.exe
--Apple-Mail-3--215844525
Content-Disposition: attachment;
filename=npclasstestmain.cs
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="npclasstestmain.cs"
using Mcs.Test;
namespace Mcs.Testdriver {
public class M {
public static void Main() {
Bar bar = null;
System.Console.WriteLine(bar);
}
}
}
--Apple-Mail-3--215844525
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
just d/l the files and run the test script to see.
cheers,
John
--Apple-Mail-3--215844525--