The following snippet:
==========8<==========8<==========8<==========8<==========
class Foo {
protected override void Finalize() {
try {
System.Console.WriteLine("Foo::Finalize()");
} finally {
base.Finalize();
}
}
}
class Bar : Foo {
protected override void Finalize() {
try {
System.Console.WriteLine("Bar::Finalize()");
} finally {
base.Finalize();
}
}
}
class Test {
static void Main() {
new Bar();
}
}
==========8<==========8<==========8<==========8<==========
compiles under mcs but generates an error under csc. The mcs generated
binary runs and gives this result:
==========8<==========8<==========8<==========8<==========
Bar::Finalize()
Foo::Finalize()
Foo::Finalize()
==========8<==========8<==========8<==========8<==========
Instead of generating a "You should not override object.Finalize()"
error message as csc does, mcs not only compiles the method, but also
add a call to base.Finalize() in the body of Finalize() in a finally
block.
Is this the desired behavior?
--
Weiqi Gao
[EMAIL PROTECTED]
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list