Currently, mixins sometimes make an undocumented (and unchecked) assumption that any instance will be an instance of some other class. For example, in VisualEditor, any class that mixes in ve.ce.ActiveNode must inherit from ve.ce.Node. Something like the following behaviour would be good:
OO.initMixinClass( ve.ce.ActiveNode, ve.ce.Node ); MyClass = function () {}; // Throws Error: ve.ce.ActiveNode can only be applied to a subclass of ve.ce.Node OO.mixinClass( MyClass, ve.ce.ActiveNode );
See also: T92540 ("Require classes being mixed in to be plain objects")