UNPKG

typir

Version:

General purpose type checking library

29 lines 1.95 kB
/****************************************************************************** * Copyright 2025 TypeFox GmbH * This program and the accompanying materials are made available under the * terms of the MIT License, which is available in the project root. ******************************************************************************/ import { Type } from '../../graph/type-node.js'; import { CompositeTypeInferenceRule, InferenceProblem } from '../../services/inference.js'; import { TypirSpecifics } from '../../typir.js'; import { FunctionCallInferenceRule } from './function-inference-call.js'; /** * Custom inference rule for functions, which consists of one inference rule for each overload/signature for a function with same name. * Each of these inference rules is an instance of `FunctionCallInferenceRule`. * * When deadling with multiple inference rules, usually the first successful inference rule is applied and following inference rules are ignored. * In order to deal with multiple matching inference rules for overloaded functions, * all available inference rules need to be executed and all successful inference rules need to be collected. */ export declare class OverloadedFunctionsTypeInferenceRule<Specifics extends TypirSpecifics> extends CompositeTypeInferenceRule<Specifics> { protected inferTypeLogic(languageNode: Specifics['LanguageType']): Type | Array<InferenceProblem<Specifics>>; protected handleMultipleBestMatches(matchingOverloads: Array<OverloadedMatch<Specifics>>): OverloadedMatch<Specifics> | undefined; protected compareMatchingOverloads(match1: OverloadedMatch<Specifics>, match2: OverloadedMatch<Specifics>): number; protected calculateCost(match: OverloadedMatch<Specifics>): number; } interface OverloadedMatch<Specifics extends TypirSpecifics> { result: Type; rule: FunctionCallInferenceRule<Specifics>; } export {}; //# sourceMappingURL=function-inference-overloaded.d.ts.map