[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)
> > If a declaration like
> > "l:Lockable" simply means "check that l happens to include the
> > methods in the Lockable interface", the declaration gives a
> > misleadingly strong impression that some kind of agreed-upon
> > contract is being satisfied, when it isn't necessarily.
> The semantics I have in mind would be that there would be compile-time
> checking of the contract.
I'm saying that unless the class designer explicitly specifies that a class
supports a particular interface, the fact that it happens to contain a set
of methods that look like they might belong to that interface isn't good
enough. The methods that the compiler is seeing may not even be related to
each other. No matter when you check this, it's a very weak sort of type
check, that may give the appearance of being stronger than it really is,
since variables that are declared as e.g. Lockable, may not be.