This is a terrible idea. A rectangle by definition has width and height independent of each other. A square does not fit that description and thus is not a rectangle.
Even if you did something like implementing the square's size as an average of the underlying rectangle's width and height, which would apparently support both classes correctly, you will get in trouble with the semantics or with other, less "fakeable" properties of these objects.