Class DefaultTypeInferenceCollector

Collects an arbitrary number of inference rules and allows to infer a type for a given language node.

Hierarchy (View Summary)

Implements

Constructors

Properties

inferenceRules: Map<string, TypeInferenceRule[]> = ...
languageNodeInference: LanguageNodeInferenceCaching
services: TypirServices

Methods

  • Registers an inference rule. When inferring the type for a language node, all registered inference rules are checked until the first match.

    Parameters

    • rule: TypeInferenceRule

      a new inference rule

    • OptionalboundToType: Type

      an optional type, if the new inference rule is dedicated for exactly this type. If the given type is removed from the type system, this rule will be automatically removed as well.

    Returns void