(setq notdirect (append notdirect (comp-supertypes parent))))
finally return direct)))
+(defsubst comp-subtype-p (type1 type2)
+ "Return t if TYPE1 is a subtype of TYPE2 or nil otherwise."
+ (let ((types (cons type1 type2)))
+ (or (gethash types (comp-cstr-ctxt-subtype-p-mem comp-ctxt))
+ (puthash types
+ (memq type2 (comp-supertypes type1))
+ (comp-cstr-ctxt-subtype-p-mem comp-ctxt)))))
+
(defun comp--normalize-typeset0 (typeset)
;; For every type search its supertypes. If all the subtypes of a
;; supertype are presents remove all of them, add the identified
(if above (comp--intersection x above) x)))))
finally return above))
-(defsubst comp-subtype-p (type1 type2)
- "Return t if TYPE1 is a subtype of TYPE2 or nil otherwise."
- (let ((types (cons type1 type2)))
- (or (gethash types (comp-cstr-ctxt-subtype-p-mem comp-ctxt))
- (puthash types
- (memq type2 (comp-supertypes type1))
- (comp-cstr-ctxt-subtype-p-mem comp-ctxt)))))
-
(defun comp-union-typesets (&rest typesets)
"Union types present into TYPESETS."
(or (gethash typesets (comp-cstr-ctxt-union-typesets-mem comp-ctxt))