Class UniqueFunctionValidation<Specifics>

Predefined validation to produce errors for those (overloaded) functions which cannot be distinguished when calling them. By default, only the name and the types of the input parameters are used to distinguish functions.

Type Parameters

Implements

Constructors

Properties

foundDeclarations: Map<string, Specifics["LanguageType"][]> = ...
isRelevant: undefined | (languageNode: Specifics["LanguageType"]) => boolean

Use this check to filter language nodes which are relevant for the creation of functions, e.g. ensure that only function declarations are covered and no calls of function which have a function as return type. Beyond that, this check improves performance, since type inference will be done only for the filtered language nodes. Instead of using this filter, the 'language key' to register this validation rules can be exploited for the same purposes.

Methods

  • Calculates a key for a function which encodes its unique properties, i.e. duplicate functions have the same key. This key is used to identify duplicated functions. Override this method to change the properties which make a function unique. By default, only the name and the types of the input parameters are relevant.

    Parameters

    Returns string

    a string key