It seems that a class that implements an interface cannot rely on
inherited methods to have implemented some of the methods already.
Boo insists that all the methods are declared and implemented in the
actual class which implements the interface. Whereas C# (and common
sense?) says that if a class inherits from a class that already
implements all the methods, then the contract is satisfied.
The example below fails to instantiate B, the error message is about B not implementing an interface etc.
In either case, though, its just wrong to say that class B doesn't
implement IDo.
----------------------------------
import System
interface IDo:
def Do1()
def Do2()
class A:
def Do1():
pass
class B(A, IDo):
#def Do1(): # Shouldn't need to implement again since
- pass # Class B inherits Do1() from class A
def Do2():
pass
b = B() # FAILS since B doesn't implement Do1()
----------------------------------
See Google thread
http://groups.google.com/group/boolang/browse_thread/thread/a9446572632cea8d?hl=en
Doug H confirms this bug.
BCW0001: WARNING: Type 'B' does not provide an implementation for 'IDo.Do1()' and will be marked abstract
BCE0085: Boo.Lang.Compiler.CompilerError: Cannot create instance of abstract class 'B'.