[Mono-list] Possible bug in mcs.

A Rafael D Teixeira rafaelteixeirabr@hotmail.com
Wed, 31 Jul 2002 12:01:28 -0300


>: [bagfors@detrius]$ ; mcs --target library test.cs
>test.cs(9) error CS0117: 'Test+TestInterface' does not contain a
>definition for 'test'
>Compilation failed: 1 error(s), 0 warnings
>---------------------------------
>
>That doesn't work well at all.  Moving the last "}" above "interface
>TestInterface" so that the interface and the class TestClass are
>declared outside of class Test it compiles (and runs) just fine.
>

In VS.NET

using System;
class Test
{
public static void Main()
{
Console.WriteLine("test");
TestClass tst = new TestClass();
tst.test("test");
TestInterface ti = (TestInterface)tst;
ti.test("test");
Console.ReadLine();
}
public interface TestInterface
{
string test(string name);
}
public class TestClass: TestInterface
{
public string test(string name)
{
Console.WriteLine("test2");
return name + " testar";
}
}
}

compiles and runs giving:

test
test2
test2

It surely looks like a mcs bug, probably with nesting of definitions (inner 
classes and interfaces).

Fill a Bugzilla form about this one please...

Rafael Teixeira
Brazilian Polymath



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com