c12f5f6055
This commit introduces TypeConstructor.refine method. It's implementation can be roughly split in three parts: - trivial implementations which just return 'this': mostly, it used for typeConstructors which can not be refined at all (e.g. IntegerValueTypeConstructor and other special cases of constructors) - delegating implementations which call 'refine' recursively for component typeConstructors -- obviously, they are used in composite typeConstructors (like IntersectionTypeConstructor) - finally, the most interesting one is in 'AbstractTypeConstructor' which returns lightweight wrapper called 'ModuleViewTypeConstructor'. The idea here is to propagate refinement to supertypes without eagerly computing them all. VERY IMPORTANT CAVEAT of TypeConstructor.refine is that call to this method CAN NOT add new supertypes, so returned supertypes are not entirely "valid". See the KDoc for TypeConstructor.refine for details