Protected ReadonlycollectorThe collector for inference rules, at which this composite rule should be registered.
Protected ReadonlylanguageProtected ReadonlylistenersProtected ReadonlyruleProtected ReadonlyservicesRegisters an inference rule. If an inference rule might be registered a second time, only those options are applied, which are not applied yet Listeners will be informed only about these "difference" options.
a new inference rule
OptionalgivenOptions: Partial<TypeInferenceRuleOptions>additional options
ProtectedcacheProtectedcacheProtectedcacheProtectedcheckProtectedexecuteInfers a type for the given language node.
the language node whose type shall be inferred
the found Type or some inference problems (might be empty), when none of the inference rules were able to infer a type
ProtectedinferProtectedinfer2nd step is to finally decide about the inferred type. When the 1st step returned a list of language nodes to resolve their types, this function is called in order to complete this inference rule, otherwise, this step is not called. Advantage of this step is to split it to allow a postponed inferrence of the additional language nodes by Typir. Disadvantage of this step is, that already checked TS types of languageNode cannot be reused.
the finally inferred type or a problem, why this inference rule is finally not applicable
1st step is to check, whether this inference rule is applicable to the given language node.
the language node whose type shall be inferred
Only in the case, that child language nodes are returned, the other function will be called for step 2, otherwise, it is skipped.
ProtectedpendingProtectedpendingDeregisters an inference rule.
the rule to remove
OptionaloptionsToRemove: Partial<TypeInferenceRuleOptions>The inference rule will be deregistered only regarding the given options, the inference rule might still be registered for the not-specified options. Listeners will be informed only about those removed options which were existing before.
This inference rule uses multiple internal inference rules for doing the type inference. If one of the child rules returns a type, this type is the result of the composite rule. Otherwise, all problems of all child rules are returned.
This composite rule ensures itself, that it is associated to the set of language keys of the inner rules.