Code Sample compiles fine here with (VS.NET) csc with /target:library (and
without it)
runs too with
test
test2
test2
as the output
under mono 0.13
simon@gemini:~/MONO/test$ mcs test.cs
test.cs(9) error CS0117: `Test+TestInterface' does not contain a definition
for `test'
Compilation failed: 1 error(s), 0 warnings
simon@gemini:~/MONO/test$ 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
Regards
Simon
----- Original Message -----
From: "Erik Bagfors" <[EMAIL PROTECTED]>
To: "Mono List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 3:18 PM
Subject: [Mono-list] Possible bug in mcs.
Hi! I assume that this is a bug but I'm not 100% sure because I don't
know C# that well and I can't test it under windows with the ms-tools.
------------------------------------
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");
}
public interface TestInterface {
string test(string name);
}
public class TestClass: TestInterface {
public string test(string name) {
Console.WriteLine("test2");
return name + " testar";
}
}
}
------------------------------------
: [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.
Can anyone comment on this?
/Erik
--
Erik B�gfors | [EMAIL PROTECTED]
Supporter of free software | GSM +46 733 279 273
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list