Question: According to [Wikipedia](https://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29) the Liskov substitution principle states that

> 
> objects in a program should be replaceable with instances of their
>  subtypes without altering the correctness of that program
> 
> 
> 

Normally the Liskov substitution principle doesn't apply to classes because they are not objects.

Now in Ruby, classes are objects too. The most basic class from which all other classes inherit is `BasicObject`. `BasicObject` allows the `.new` class method (the "constructor"; it allocates an object and executes the instance method `#initialize` on it) to be called without arguments.

In this case I suspect that the Liskov principle would imply that now each subclass must also support `.new` without any arguments, because the subclass is an object and if it wouldn't support it, the subclass wouldn't be a substitute for it's parent class. If applied literally, one consequence would be that every constructor has to support being called without any arguments.

This seems odd. But I wonder if there is any point in going into that direction? Or is this just an incompatibility of the Liskov principle (which assumes that the set of all objects and the set of all classes are disjunct) and Ruby (where the set of all classes is a subset of the set of all objects).

This strangely reminds me of [Russell's antinomy](https://en.wikipedia.org/wiki/Russell's_paradox), a paradox, which, as far as I understand, was resolved by separating classes and instances (make them disjunct).

Answer: 
> 
> In this case I suspect that the Liskov principle would imply that now
>  each subclass must also support .new without any arguments
> 
> 
> 

Your suspicion is wrong.

The problem is that you're inferring from the base class's implementation what the base class's contract is. But they are two distinct things, even if not literally written out separately. In this case, the base class's contract is that you can construct things with `new`, and if the arguments are incorrect, you may error (e.g. throw). 

The fact that in the base class, zero arguments is acceptable, does not immediately require that in the contract, zero arguments is acceptable and must be allowable by all derived classes.

It's merely a *default implementation* of a contract. It may permit things outside that contract. It may offer things that are optionally part of that contract. There's no strict 1:1 relationship between the base class's implementation and the contract. You can't assume that just because the base class's implementation permits something that it is immediately a mandatory part of the contract.

However, in answer to the most general part of your question, then yes. Class metatypes are instances like any other and obey the same rules as any other inheritance hierarchy, including LSP.
> 
> In this case I suspect that the Liskov principle would imply that now each subclass must also support .new without any arguments
> 
> 
> 

That's not correct.

You require here that the metaobject of some class derived from `BaseObject` need to support niladic new, because the metaobject of `BaseObject` does.

The LSP states that objects of a subclass must support the same interface as the the base class.

The disconnect here is that the metaobjects of `Derived` and `BaseObject` are both instances of `Class`, not of `Derived` and `BaseObject` respectively, thus the LSP does not apply. You could argue that as instances of the same class, they still should have the same interface, but a) that's not part of the LSP, and b) that's not how Ruby works.