@artel/artc 0.6.26039 → 0.8.26001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Cli.js +3 -3
- package/build/api/Api.js +19 -15
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +11426 -5066
- package/build/{chunk-LTJPPRSR.js → chunk-55LNCV63.js} +87206 -50765
- package/build/{chunk-5VVFNKOH.js → chunk-6XVQ7FTB.js} +2 -2
- package/build/{chunk-AEW4TILW.js → chunk-PUDLDJ7V.js} +1 -1
- package/build/types/analysis/Analyzer.d.ts +6 -1
- package/build/types/analysis/TypeMemberLookup.d.ts +3 -1
- package/build/types/analysis/WellKnownDeclarations.d.ts +54 -0
- package/build/types/analysis/a/Analyzer.d.ts +4 -4
- package/build/types/analysis/a/IdentifierExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/a/MemberAccessExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/a/ModifierValidator.d.ts +3 -2
- package/build/types/analysis/a/ResolvedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/a/SourceFileAnalyzer.d.ts +1 -1
- package/build/types/analysis/a/SourcePackageMembersCreator.d.ts +1 -2
- package/build/types/analysis/a/TreeQuery.d.ts +1 -2
- package/build/types/analysis/a/TypeMemberLookup.d.ts +3 -1
- package/build/types/analysis/a/semantic-context/FieldWithInitializerSemanticContext.d.ts +3 -3
- package/build/types/analysis/a/semantic-context/SemanticContext.d.ts +2 -2
- package/build/types/analysis/a/semantic-context/SemanticContextBuilder.d.ts +10 -12
- package/build/types/analysis/a/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +0 -1
- package/build/types/analysis/a/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +5 -4
- package/build/types/analysis/a/semantic-context/SubprogramSemanticContext.d.ts +11 -10
- package/build/types/analysis/a/semantic-context/TypeSemanticContext.d.ts +13 -13
- package/build/types/analysis/m/Analyzer.d.ts +425 -1
- package/build/types/analysis/m/ArgumentToParameterMatchResult.d.ts +23 -0
- package/build/types/analysis/m/ArgumentsToParametersMatcher.d.ts +40 -0
- package/build/types/analysis/m/BaseExpressionMeaning.d.ts +25 -0
- package/build/types/analysis/m/CallExpressionMeaning.d.ts +72 -0
- package/build/types/analysis/m/ConstructorCallResolver.d.ts +24 -0
- package/build/types/analysis/m/DeclarationsUsageCounter.d.ts +12 -0
- package/build/types/analysis/m/DereferenceExpressionMeaning.d.ts +28 -0
- package/build/types/analysis/m/ExpressionAnalysisOptions.d.ts +21 -0
- package/build/types/analysis/m/FunctionAccessResolver.d.ts +19 -0
- package/build/types/analysis/m/IdentifierExpressionMeaning.d.ts +137 -0
- package/build/types/analysis/m/IndexedAccessExpressionMeaning.d.ts +32 -0
- package/build/types/analysis/m/InstanceFieldsInitializationValidator.d.ts +18 -0
- package/build/types/analysis/m/MemberAccessExpressionMeaning.d.ts +137 -0
- package/build/types/analysis/m/ModifierFlags.d.ts +20 -0
- package/build/types/analysis/m/NamedTypeResolver.d.ts +44 -0
- package/build/types/analysis/m/NamedTypeSpecifierResolver.d.ts +19 -0
- package/build/types/analysis/m/ObjectExpressionMeaning.d.ts +29 -0
- package/build/types/analysis/m/OverloadResolver.d.ts +104 -0
- package/build/types/analysis/m/OwnAndBaseConstructorCallsChecker.d.ts +36 -0
- package/build/types/analysis/m/PackageAndStaticVariablesInitializationValidator.d.ts +17 -0
- package/build/types/analysis/m/ReachabilityChecker.d.ts +27 -0
- package/build/types/analysis/m/ReductionSourceMemberFinder.d.ts +17 -0
- package/build/types/analysis/m/ReservedNameDictionary.d.ts +15 -0
- package/build/types/analysis/m/ResolvedTranslationPackage.d.ts +68 -0
- package/build/types/analysis/m/ReturnTypeInferrer.d.ts +13 -0
- package/build/types/analysis/m/SourceFileAnalyzer.d.ts +131 -0
- package/build/types/analysis/m/SourcePackageMembersCreator.d.ts +7 -0
- package/build/types/analysis/m/SourceTypeMembersCreator.d.ts +9 -0
- package/build/types/analysis/m/StaticDeclarationMeaning.d.ts +32 -0
- package/build/types/analysis/m/SyntacticAccessKind.d.ts +6 -0
- package/build/types/analysis/m/TagMeaning.d.ts +70 -0
- package/build/types/analysis/m/TextIdentity.d.ts +7 -0
- package/build/types/analysis/m/TranslatedEntityNameConflictsValidator.d.ts +28 -0
- package/build/types/analysis/m/TreeQuery.d.ts +15 -0
- package/build/types/analysis/m/TypeArgumentInferrer.d.ts +52 -0
- package/build/types/analysis/m/TypeInferrer.d.ts +11 -0
- package/build/types/analysis/m/TypeMemberLookup.d.ts +4 -1
- package/build/types/analysis/m/TypeNarrower.d.ts +31 -0
- package/build/types/analysis/m/TypeOverloadResolver.d.ts +9 -0
- package/build/types/analysis/m/UserDefinableBinaryOperatorResolver.d.ts +34 -0
- package/build/types/analysis/m/UserDefinableUnaryOperatorResolver.d.ts +23 -0
- package/build/types/analysis/m/VariableIsAssignedChecker.d.ts +11 -0
- package/build/types/analysis/m/VariableIsNotAssignedChecker.d.ts +12 -0
- package/build/types/analysis/m/control-flow/GraphBuilder.d.ts +52 -0
- package/build/types/analysis/m/control-flow/GraphVisualizer.d.ts +12 -0
- package/build/types/analysis/m/control-flow/NarrowableExpression.d.ts +5 -0
- package/build/types/analysis/m/control-flow/NarrowableReference.d.ts +72 -0
- package/build/types/analysis/m/control-flow/Nodes.d.ts +112 -0
- package/build/types/analysis/m/control-flow/index.d.ts +5 -0
- package/build/types/analysis/m/semantic-context/Declarations.d.ts +94 -0
- package/build/types/analysis/m/semantic-context/FieldWithInitializerSemanticContext.d.ts +28 -0
- package/build/types/analysis/m/semantic-context/SemanticContext.d.ts +14 -0
- package/build/types/analysis/m/semantic-context/SemanticContextBase.d.ts +190 -0
- package/build/types/analysis/m/semantic-context/SemanticContextBuilder.d.ts +69 -0
- package/build/types/analysis/m/semantic-context/SemanticContextValidatingNameConflicts.d.ts +51 -0
- package/build/types/analysis/m/semantic-context/SemanticContextWithParent.d.ts +12 -0
- package/build/types/analysis/m/semantic-context/SourceFileSemanticContext.d.ts +63 -0
- package/build/types/analysis/m/semantic-context/StaticDeclarationSemanticContext.d.ts +26 -0
- package/build/types/analysis/m/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +108 -0
- package/build/types/analysis/m/semantic-context/SubprogramSemanticContext.d.ts +92 -0
- package/build/types/analysis/m/semantic-context/TypeSemanticContext.d.ts +93 -0
- package/build/types/analysis/m/semantic-context/index.d.ts +10 -0
- package/build/types/common/LocalizationHelper.d.ts +3 -1
- package/build/types/common/LocalizationHelperA.d.ts +0 -2
- package/build/types/common/LocalizationHelperM.d.ts +13 -0
- package/build/types/common/Name.d.ts +1 -1
- package/build/types/common/index.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +211 -192
- package/build/types/diagnostic/TokenDiagnosticM.d.ts +2 -0
- package/build/types/emitter/EmitPhaseName.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +4 -2
- package/build/types/emitter/IrBuilderM.d.ts +124 -0
- package/build/types/emitter/IrFactory.d.ts +2 -2
- package/build/types/entities/Entity.d.ts +8 -5
- package/build/types/entities/EntityLocalizationContext.d.ts +3 -2
- package/build/types/entities/OperatorKind.d.ts +13 -18
- package/build/types/entities/Translation.d.ts +4 -3
- package/build/types/entities/interfaces/AliasTypeEntity.d.ts +4 -1
- package/build/types/entities/interfaces/DereferenceOperatorEntity.d.ts +3 -1
- package/build/types/entities/interfaces/FunctionEntity.d.ts +3 -1
- package/build/types/entities/interfaces/FunctionTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/IndexerEntity.d.ts +4 -1
- package/build/types/entities/interfaces/PackageAliasEntity.d.ts +4 -1
- package/build/types/entities/interfaces/PackageEntity.d.ts +2 -1
- package/build/types/entities/interfaces/ReducedTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +9 -2
- package/build/types/entities/interfaces/TextTranslationEntity.d.ts +4 -1
- package/build/types/entities/interfaces/TypeExtensionEntity.d.ts +4 -1
- package/build/types/entities/interfaces/TypeParameterEntity.d.ts +7 -3
- package/build/types/entities/interfaces/VariableEntity.d.ts +3 -2
- package/build/types/entities/interfaces/VariantTypeEntity.d.ts +3 -1
- package/build/types/entities/interfaces/m/ConstructorEntityM.d.ts +10 -0
- package/build/types/entities/interfaces/m/DestructorEntityM.d.ts +8 -0
- package/build/types/entities/interfaces/m/index.d.ts +2 -0
- package/build/types/entities/source/a/SourceFunctionEntity.d.ts +1 -1
- package/build/types/entities/source/a/SourcePackageEntity.d.ts +2 -1
- package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +3 -5
- package/build/types/entities/source/m/SourceAliasTypeEntity.d.ts +32 -0
- package/build/types/entities/source/m/SourceConstructorEntity.d.ts +40 -0
- package/build/types/entities/source/m/SourceDestructorEntity.d.ts +38 -0
- package/build/types/entities/source/m/SourceFunctionEntity.d.ts +252 -0
- package/build/types/entities/source/m/SourceFunctionTypeEntity.d.ts +35 -0
- package/build/types/entities/source/m/SourceGetterEntity.d.ts +122 -0
- package/build/types/entities/source/m/SourceIndexerEntity.d.ts +36 -0
- package/build/types/entities/source/m/SourcePackageAliasEntity.d.ts +22 -0
- package/build/types/entities/source/m/SourcePackageEntity.d.ts +68 -0
- package/build/types/entities/source/m/SourceSetterEntity.d.ts +122 -0
- package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +111 -0
- package/build/types/entities/source/m/SourceTextTranslationEntity.d.ts +29 -0
- package/build/types/entities/source/m/SourceTypeParameterEntity.d.ts +30 -0
- package/build/types/entities/source/m/SourceVariableEntity.d.ts +447 -0
- package/build/types/entities/source/m/SourceVariantTypeEntity.d.ts +38 -0
- package/build/types/entities/source/m/index.d.ts +15 -0
- package/build/types/entities/translated/TranslatedPackageEntity.d.ts +2 -1
- package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +33 -1
- package/build/types/entities/translated/source/a/SourceTranslatedPackageStructuredTypeEntity.d.ts +8 -2
- package/build/types/entities/translated/source/m/SourceTranslatedAliasTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/SourceTranslatedDestructorEntity.d.ts +12 -0
- package/build/types/entities/translated/source/m/SourceTranslatedFunctionEntity.d.ts +24 -0
- package/build/types/entities/translated/source/m/SourceTranslatedFunctionTypeEntity.d.ts +13 -0
- package/build/types/entities/translated/source/m/SourceTranslatedIndexerEntity.d.ts +12 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageEntity.d.ts +19 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageStructuredTypeEntity.d.ts +26 -0
- package/build/types/entities/translated/source/m/SourceTranslatedPackageVariantTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/SourceTranslatedReducedTypeEntity.d.ts +14 -0
- package/build/types/entities/translated/source/m/index.d.ts +9 -0
- package/build/types/parser/a/KeywordDictionary.d.ts +2 -3
- package/build/types/parser/a/Parser.d.ts +2 -2
- package/build/types/parser/m/ConvertTokenKind.d.ts +3 -0
- package/build/types/parser/m/KeywordDictionary.d.ts +33 -0
- package/build/types/parser/m/Parser.d.ts +7 -0
- package/build/types/parser/m/Scanner.d.ts +56 -0
- package/build/types/parser/m/TokenKind.d.ts +81 -0
- package/build/types/parser/m/TriviaInterner.d.ts +8 -0
- package/build/types/project/SourceFile.d.ts +5 -6
- package/build/types/services/LanguageServer.d.ts +23 -12
- package/build/types/services/a/NodeSemanticInfo.d.ts +2 -2
- package/build/types/services/common/WorkspaceItemsService.d.ts +1 -0
- package/build/types/services/common/completion/Types.d.ts +8 -2
- package/build/types/services/common/display/DisplayService.d.ts +3 -0
- package/build/types/services/common/display/Types.d.ts +2 -2
- package/build/types/services/m/CodeActionsService.d.ts +10 -0
- package/build/types/services/m/CompletionService.d.ts +60 -0
- package/build/types/services/m/DefinitionService.d.ts +11 -0
- package/build/types/services/m/DisplayService.d.ts +52 -0
- package/build/types/services/m/EvaluatableExpressionService.d.ts +10 -0
- package/build/types/services/m/HoverService.d.ts +11 -0
- package/build/types/services/m/NodeSemanticInfo.d.ts +46 -0
- package/build/types/services/m/RenameService.d.ts +11 -0
- package/build/types/services/m/SelectionRangeService.d.ts +7 -0
- package/build/types/services/m/SemanticTokensService.d.ts +11 -0
- package/build/types/services/m/SourceFileItemsService.d.ts +10 -0
- package/build/types/services/m/TranslationService.d.ts +23 -0
- package/build/types/services/m/TranslationsGenerationService.d.ts +7 -0
- package/build/types/services/m/TreeUtils.d.ts +58 -0
- package/build/types/services/m/references/DefinitionInfoFinder.d.ts +6 -0
- package/build/types/services/m/references/ReferencesFinder.d.ts +7 -0
- package/build/types/services/m/signature-help/ParametersSignatureHelpProvider.d.ts +15 -0
- package/build/types/services/m/signature-help/SignatureHelpService.d.ts +6 -0
- package/build/types/services/m/signature-help/SignatureWithParameters.d.ts +94 -0
- package/build/types/services/m/signature-help/TypeParameterSignatureHelpProvider.d.ts +21 -0
- package/build/types/services/m/signature-help/utils.d.ts +9 -0
- package/build/types/tree/a/KeywordKind.d.ts +1 -3
- package/build/types/tree/a/NodeKind.d.ts +113 -114
- package/build/types/tree/a/Nodes.d.ts +6 -5
- package/build/types/tree/a/OperatorKind.d.ts +5 -0
- package/build/types/tree/a/Types.d.ts +9 -4
- package/build/types/tree/m/BaseNode.d.ts +8 -40
- package/build/types/tree/m/KeywordFlags.d.ts +4 -0
- package/build/types/tree/m/KeywordKind.d.ts +40 -0
- package/build/types/tree/m/NodeKind.d.ts +147 -2
- package/build/types/tree/m/Nodes.d.ts +2064 -9
- package/build/types/tree/m/NodesDebug.d.ts +9 -0
- package/build/types/tree/m/OperatorKind.d.ts +39 -0
- package/build/types/tree/m/SyntaxToCode.d.ts +107 -0
- package/build/types/tree/m/Token.d.ts +46 -0
- package/build/types/tree/m/TokenFlags.d.ts +12 -0
- package/build/types/tree/m/TokenKind.d.ts +61 -60
- package/build/types/tree/m/TreeTraversal.d.ts +18 -0
- package/build/types/tree/m/Types.d.ts +46 -0
- package/build/types/tree/m/Utils.d.ts +7 -0
- package/build/types/tree/m/index.d.ts +9 -0
- package/build/types/types/StandardTypes.d.ts +2 -0
- package/package.json +1 -1
- /package/build/types/diagnostic/{TokenDiagnostic.d.ts → TokenDiagnosticA.d.ts} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { DereferenceExpression } from '../../tree/m/index.js';
|
|
3
|
+
import * as types from '../../types/index.js';
|
|
4
|
+
import { ComputedAccess } from '../ComputedAccess.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
export declare class Resolver {
|
|
7
|
+
private readonly analyzer;
|
|
8
|
+
private readonly node;
|
|
9
|
+
private readonly diagnostics;
|
|
10
|
+
private readonly semanticContext_;
|
|
11
|
+
private get semanticContext();
|
|
12
|
+
constructor(analyzer: Analyzer, node: DereferenceExpression, diagnostics: DiagnosticAcceptor | undefined);
|
|
13
|
+
resolve(): Meaning;
|
|
14
|
+
private createComputedAccess;
|
|
15
|
+
private getAccessibleDereferenceOperatorGetter;
|
|
16
|
+
private getAccessibleDereferenceOperatorSetter;
|
|
17
|
+
}
|
|
18
|
+
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
|
19
|
+
declare class Meaning_resolved {
|
|
20
|
+
readonly operator: types.DereferenceOperator;
|
|
21
|
+
readonly access: ComputedAccess;
|
|
22
|
+
readonly kind = "resolved";
|
|
23
|
+
constructor(operator: types.DereferenceOperator, access: ComputedAccess);
|
|
24
|
+
}
|
|
25
|
+
declare class Meaning_unresolved {
|
|
26
|
+
readonly kind = "unresolved";
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as types from '../../types/index.js';
|
|
2
|
+
export declare class ExpressionAnalysisOptions {
|
|
3
|
+
readonly targetType: types.Type | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Определяет, можно ли кэшировать результат анализа выражений, если результат зависит от целевого типа. Результат
|
|
6
|
+
* анализа, который не зависит от целевого типа, можно кэшировать всегда.
|
|
7
|
+
*/
|
|
8
|
+
readonly allowCaching: boolean;
|
|
9
|
+
readonly isResolvingOverload: boolean;
|
|
10
|
+
constructor(targetType: types.Type | undefined,
|
|
11
|
+
/**
|
|
12
|
+
* Определяет, можно ли кэшировать результат анализа выражений, если результат зависит от целевого типа. Результат
|
|
13
|
+
* анализа, который не зависит от целевого типа, можно кэшировать всегда.
|
|
14
|
+
*/
|
|
15
|
+
allowCaching: boolean, isResolvingOverload: boolean);
|
|
16
|
+
static withTargetType(options: ExpressionAnalysisOptions | undefined, targetType: types.Type | undefined): ExpressionAnalysisOptions;
|
|
17
|
+
withTargetType(targetType: types.Type | undefined): ExpressionAnalysisOptions;
|
|
18
|
+
withAllowCaching(allowCaching: boolean): ExpressionAnalysisOptions;
|
|
19
|
+
withIsResolvingOverload(isResolvingOverload: boolean): ExpressionAnalysisOptions;
|
|
20
|
+
withTargetTypeAndAllowCaching(targetType: types.Type | undefined, allowCaching: boolean): ExpressionAnalysisOptions;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DiagnosticAcceptorWithArgumentFactory } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import * as tree from '../../tree/m/index.js';
|
|
3
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from '../AccessedFunction.js';
|
|
4
|
+
import { NodeOrDiagnosticLocation } from '../NodeOrDiagnosticLocation.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
import { ExpressionAnalysisOptions } from './ExpressionAnalysisOptions.js';
|
|
7
|
+
export declare class Resolver {
|
|
8
|
+
static resolveByCallExpression(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], node: tree.CallExpression, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined): ResolutionResult;
|
|
9
|
+
static resolveByCallExpressionParts(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], argumentList: tree.ArgumentList | undefined, typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, diagnosticLocation: NodeOrDiagnosticLocation | undefined): ResolutionResult;
|
|
10
|
+
static resolveByTargetType(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, diagnosticLocation: NodeOrDiagnosticLocation | undefined): ResolutionResult;
|
|
11
|
+
private static convertProcessedSignature;
|
|
12
|
+
private static reportAmbiguousAccessDiagnostic;
|
|
13
|
+
}
|
|
14
|
+
export declare class ResolutionResult {
|
|
15
|
+
readonly suitableFunctions: readonly AccessedFunction[];
|
|
16
|
+
readonly singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined;
|
|
17
|
+
get suitableOrSingleFunction(): AccessedFunction | undefined;
|
|
18
|
+
constructor(suitableFunctions: readonly AccessedFunction[], singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined);
|
|
19
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Name } from '../../common/index.js';
|
|
2
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
3
|
+
import { NamedTypeEntity, PackageAliasEntity, ParameterEntity, VariableEntity } from '../../entities/index.js';
|
|
4
|
+
import * as tree from '../../tree/m/index.js';
|
|
5
|
+
import * as types from '../../types/index.js';
|
|
6
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from '../AccessedFunction.js';
|
|
7
|
+
import { ComputedAccess } from '../ComputedAccess.js';
|
|
8
|
+
import { PackageNameTreeNode } from '../ImportedPackageNameTree.js';
|
|
9
|
+
import { Analyzer } from './Analyzer.js';
|
|
10
|
+
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
11
|
+
import { ExpressionAnalysisOptions } from './ExpressionAnalysisOptions.js';
|
|
12
|
+
import { NamedDeclaration } from './semantic-context/index.js';
|
|
13
|
+
export declare class FirstStageResolver {
|
|
14
|
+
private readonly semanticContext_;
|
|
15
|
+
private readonly analyzer;
|
|
16
|
+
private readonly node;
|
|
17
|
+
private readonly diagnostics;
|
|
18
|
+
private get semanticContext();
|
|
19
|
+
constructor(analyzer: Analyzer, node: tree.IdentifierExpression, diagnostics: DiagnosticAcceptor | undefined);
|
|
20
|
+
resolve(): MeaningStage1;
|
|
21
|
+
private resolveVariableAccess;
|
|
22
|
+
private resolveVariableEntityAccess;
|
|
23
|
+
private resolvePackageVariableAccess;
|
|
24
|
+
private getAccessiblePackageVariableGetter;
|
|
25
|
+
private getAccessiblePackageVariableSetter;
|
|
26
|
+
private resolveFieldAccess;
|
|
27
|
+
private getAccessibleFieldGetter;
|
|
28
|
+
private getAccessibleFieldSetter;
|
|
29
|
+
private resolveAccessOfVariableWithoutExplicitAccessors;
|
|
30
|
+
private checkExpressionDenotesType;
|
|
31
|
+
private resolveTypeAccess;
|
|
32
|
+
private tryResolveVariantValueAccess;
|
|
33
|
+
private createNotSubstitutedAccessedFunction;
|
|
34
|
+
private createComputedAccessForVariableWithoutExplicitAccessors;
|
|
35
|
+
}
|
|
36
|
+
export declare class SecondStageResolver {
|
|
37
|
+
private readonly analyzer;
|
|
38
|
+
private readonly node;
|
|
39
|
+
private readonly firstStageMeaning;
|
|
40
|
+
private readonly analysisOptions;
|
|
41
|
+
private readonly diagnostics;
|
|
42
|
+
constructor(analyzer: Analyzer, node: tree.IdentifierExpression, firstStageMeaning: MeaningStage1, analysisOptions: ExpressionAnalysisOptions | undefined, diagnostics: DiagnosticAcceptor | undefined);
|
|
43
|
+
resolve(): Meaning;
|
|
44
|
+
private resolveTypeAccessAtCalleePosition;
|
|
45
|
+
private resolveFunctionAccess;
|
|
46
|
+
private resolveNotCalledFunctionsAccess;
|
|
47
|
+
}
|
|
48
|
+
export type Meaning = Meaning_variableAccess | Meaning_functionAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | Meaning_typeAccess | Meaning_variantValueAccess | Meaning_typeAccessAtConstructorCall | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
49
|
+
declare class Meaning_variableAccess {
|
|
50
|
+
readonly variable: AccessedVariable;
|
|
51
|
+
readonly access: ComputedAccess;
|
|
52
|
+
readonly objectParameterContainingVariable: ParameterEntity | undefined;
|
|
53
|
+
readonly kind = "variable-access";
|
|
54
|
+
constructor(variable: AccessedVariable, access: ComputedAccess, objectParameterContainingVariable: ParameterEntity | undefined);
|
|
55
|
+
}
|
|
56
|
+
declare class Meaning_variantValueAccess {
|
|
57
|
+
readonly suitableTypes: readonly types.Type[];
|
|
58
|
+
readonly type: types.Type;
|
|
59
|
+
readonly field: types.Field;
|
|
60
|
+
readonly access: ComputedAccess;
|
|
61
|
+
readonly kind = "variant-value-access";
|
|
62
|
+
constructor(suitableTypes: readonly types.Type[], type: types.Type, field: types.Field, access: ComputedAccess);
|
|
63
|
+
}
|
|
64
|
+
declare class Meaning_functionAccess {
|
|
65
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
66
|
+
readonly suitableOrSingleFunction: AccessedFunction | undefined;
|
|
67
|
+
readonly objectParameterContainingFunctions: ParameterEntity | undefined;
|
|
68
|
+
readonly kind = "function-access";
|
|
69
|
+
constructor(candidates: readonly NotSubstitutedAccessedFunction[], suitableOrSingleFunction: AccessedFunction | undefined, objectParameterContainingFunctions: ParameterEntity | undefined);
|
|
70
|
+
}
|
|
71
|
+
declare class Meaning_packageAliasAccess {
|
|
72
|
+
readonly packageAlias: PackageAliasEntity;
|
|
73
|
+
readonly kind = "package-alias-access";
|
|
74
|
+
constructor(packageAlias: PackageAliasEntity);
|
|
75
|
+
}
|
|
76
|
+
declare class Meaning_packageNameSegmentAccess {
|
|
77
|
+
readonly packageTreeNode: PackageNameTreeNode;
|
|
78
|
+
readonly kind = "package-name-segment-access";
|
|
79
|
+
constructor(packageTreeNode: PackageNameTreeNode);
|
|
80
|
+
}
|
|
81
|
+
declare class Meaning_typeAccess {
|
|
82
|
+
readonly candidates: readonly NamedTypeEntity[];
|
|
83
|
+
readonly suitableTypes: readonly types.Type[];
|
|
84
|
+
readonly isUsedAsValue: boolean;
|
|
85
|
+
readonly kind = "type-access";
|
|
86
|
+
get singleSuitableType(): types.Type | undefined;
|
|
87
|
+
constructor(candidates: readonly NamedTypeEntity[], suitableTypes: readonly types.Type[], isUsedAsValue: boolean);
|
|
88
|
+
}
|
|
89
|
+
declare class Meaning_typeAccessAtConstructorCall {
|
|
90
|
+
readonly typeCandidates: readonly NamedTypeEntity[];
|
|
91
|
+
readonly callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall;
|
|
92
|
+
readonly kind = "type-access-at-constructor-call";
|
|
93
|
+
constructor(typeCandidates: readonly NamedTypeEntity[], callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall);
|
|
94
|
+
}
|
|
95
|
+
declare class Meaning_mixedAmbiguousAccess {
|
|
96
|
+
readonly declarations: readonly NamedDeclaration[];
|
|
97
|
+
readonly kind = "mixed-ambiguous-access";
|
|
98
|
+
constructor(declarations: readonly NamedDeclaration[]);
|
|
99
|
+
}
|
|
100
|
+
declare class Meaning_unresolved {
|
|
101
|
+
readonly kind = "unresolved";
|
|
102
|
+
}
|
|
103
|
+
export type MeaningStage1 = Meaning_variableAccess | MeaningStage1_functionAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | MeaningStage1_typeAccessAtCalleePosition | Meaning_typeAccess | Meaning_variantValueAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
104
|
+
declare class MeaningStage1_typeAccessAtCalleePosition {
|
|
105
|
+
readonly types: readonly NamedTypeEntity[];
|
|
106
|
+
readonly kind = "type-access-at-callee-position";
|
|
107
|
+
constructor(types: readonly NamedTypeEntity[]);
|
|
108
|
+
}
|
|
109
|
+
declare class MeaningStage1_functionAccess {
|
|
110
|
+
readonly functions: readonly NotSubstitutedAccessedFunction[];
|
|
111
|
+
readonly objectParameterContainingFunctions: ParameterEntity | undefined;
|
|
112
|
+
readonly kind = "function-access";
|
|
113
|
+
constructor(functions: readonly NotSubstitutedAccessedFunction[], objectParameterContainingFunctions: ParameterEntity | undefined);
|
|
114
|
+
}
|
|
115
|
+
export type AccessedVariable = AccessedVariable_entity | AccessedVariable_typeMember;
|
|
116
|
+
export declare class AccessedVariable_entity implements IAccessedVariable {
|
|
117
|
+
readonly value: VariableEntity;
|
|
118
|
+
readonly kind = "entity";
|
|
119
|
+
constructor(value: VariableEntity);
|
|
120
|
+
getEntity(): VariableEntity;
|
|
121
|
+
getName(): Name;
|
|
122
|
+
getType(): types.Type;
|
|
123
|
+
}
|
|
124
|
+
export declare class AccessedVariable_typeMember implements IAccessedVariable {
|
|
125
|
+
readonly value: types.Field;
|
|
126
|
+
readonly kind = "type-member";
|
|
127
|
+
constructor(value: types.Field);
|
|
128
|
+
getEntity(): VariableEntity;
|
|
129
|
+
getName(): Name;
|
|
130
|
+
getType(): types.Type;
|
|
131
|
+
}
|
|
132
|
+
interface IAccessedVariable {
|
|
133
|
+
getEntity(): VariableEntity;
|
|
134
|
+
getName(): Name;
|
|
135
|
+
getType(): types.Type;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { IndexedAccessExpression } from '../../tree/m/index.js';
|
|
3
|
+
import * as types from '../../types/index.js';
|
|
4
|
+
import { ComputedAccess } from '../ComputedAccess.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
export declare class Resolver {
|
|
7
|
+
private readonly analyzer;
|
|
8
|
+
private readonly node;
|
|
9
|
+
private readonly diagnostics;
|
|
10
|
+
private readonly semanticContext_;
|
|
11
|
+
private get semanticContext();
|
|
12
|
+
constructor(analyzer: Analyzer, node: IndexedAccessExpression, diagnostics: DiagnosticAcceptor | undefined);
|
|
13
|
+
resolve(): Meaning;
|
|
14
|
+
private createComputedAccess;
|
|
15
|
+
private getAccessibleIndexerGetter;
|
|
16
|
+
private getAccessibleIndexerSetter;
|
|
17
|
+
private getDiagnosticLocation;
|
|
18
|
+
}
|
|
19
|
+
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
|
20
|
+
declare class Meaning_resolved {
|
|
21
|
+
readonly candidates: readonly types.Indexer[];
|
|
22
|
+
readonly suitableIndexers: readonly types.Indexer[];
|
|
23
|
+
readonly access: ComputedAccess;
|
|
24
|
+
readonly kind = "resolved";
|
|
25
|
+
get singleSuitableIndexer(): types.Indexer | undefined;
|
|
26
|
+
get singleIndexer(): types.Indexer | undefined;
|
|
27
|
+
constructor(candidates: readonly types.Indexer[], suitableIndexers: readonly types.Indexer[], access: ComputedAccess);
|
|
28
|
+
}
|
|
29
|
+
declare class Meaning_unresolved {
|
|
30
|
+
readonly kind = "unresolved";
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import * as tree from '../../tree/m/index.js';
|
|
3
|
+
import { DeclarationsUsageMap } from '../DeclarationsUsageMap.js';
|
|
4
|
+
import { Analyzer } from './Analyzer.js';
|
|
5
|
+
export declare class InstanceFieldsInitializationValidator {
|
|
6
|
+
private readonly analyzer;
|
|
7
|
+
private readonly typeDeclaration;
|
|
8
|
+
private readonly declarationsUsageCountResult;
|
|
9
|
+
private readonly diagnostics;
|
|
10
|
+
private readonly semanticContext_;
|
|
11
|
+
private get semanticContext();
|
|
12
|
+
constructor(analyzer: Analyzer, typeDeclaration: tree.TypeWithMembersDeclaration, declarationsUsageCountResult: DeclarationsUsageMap, diagnostics: DiagnosticAcceptor);
|
|
13
|
+
validate(): void;
|
|
14
|
+
private getFieldsThatNeedToBeInitializedInConstructor;
|
|
15
|
+
private checkDefaultConstructorInitializesAllFields;
|
|
16
|
+
private checkConstructorInitializesAllFields;
|
|
17
|
+
private getFieldDiagnosticLocationWithFallback;
|
|
18
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { Entity, PackageTypeEntity, PackageVariableEntity } from '../../entities/index.js';
|
|
3
|
+
import * as tree from '../../tree/m/index.js';
|
|
4
|
+
import * as types from '../../types/index.js';
|
|
5
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from '../AccessedFunction.js';
|
|
6
|
+
import { ComputedAccess } from '../ComputedAccess.js';
|
|
7
|
+
import { PackageNameTreeNode } from '../ImportedPackageNameTree.js';
|
|
8
|
+
import { Analyzer } from './Analyzer.js';
|
|
9
|
+
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
10
|
+
import { ExpressionAnalysisOptions } from './ExpressionAnalysisOptions.js';
|
|
11
|
+
export declare class FirstStageResolver {
|
|
12
|
+
private readonly semanticContext_;
|
|
13
|
+
private readonly analyzer;
|
|
14
|
+
private readonly node;
|
|
15
|
+
private readonly diagnostics;
|
|
16
|
+
private get memberName();
|
|
17
|
+
private get semanticContext();
|
|
18
|
+
private get receiver();
|
|
19
|
+
constructor(analyzer: Analyzer, node: tree.MemberAccessExpression, diagnostics: DiagnosticAcceptor | undefined);
|
|
20
|
+
resolve(): MeaningStage1;
|
|
21
|
+
private resolvePackageAliasMemberAccessMeaning;
|
|
22
|
+
private resolvePackageMemberAccessMeaning;
|
|
23
|
+
private resolvePackageTypeAccess;
|
|
24
|
+
private resolvePackageNameSegmentAccessMeaning;
|
|
25
|
+
private resolveStaticMemberOrVariantAccessMeaning;
|
|
26
|
+
private resolveInstanceMemberAccessMeaning;
|
|
27
|
+
private resolveFieldAccess;
|
|
28
|
+
private getAccessibleFieldGetter;
|
|
29
|
+
private getAccessibleFieldSetter;
|
|
30
|
+
private resolvePackageVariableAccess;
|
|
31
|
+
private getAccessiblePackageVariableGetter;
|
|
32
|
+
private getAccessiblePackageVariableSetter;
|
|
33
|
+
private createComputedAccessForVariableWithoutExplicitAccessors;
|
|
34
|
+
}
|
|
35
|
+
export declare class SecondStageResolver {
|
|
36
|
+
private readonly analyzer;
|
|
37
|
+
private readonly node;
|
|
38
|
+
private readonly firstStageMeaning;
|
|
39
|
+
private readonly analysisOptions;
|
|
40
|
+
private readonly diagnostics;
|
|
41
|
+
constructor(analyzer: Analyzer, node: tree.MemberAccessExpression, firstStageMeaning: MeaningStage1, analysisOptions: ExpressionAnalysisOptions | undefined, diagnostics: DiagnosticAcceptor | undefined);
|
|
42
|
+
resolve(): Meaning;
|
|
43
|
+
private resolveTypeAccessAtCalleePosition;
|
|
44
|
+
private resolvePackageFunctionAccess;
|
|
45
|
+
private resolveStaticMethodAccess;
|
|
46
|
+
private resolveInstanceMethodAccess;
|
|
47
|
+
private resolveNotCalledFunctionsAccess;
|
|
48
|
+
}
|
|
49
|
+
export type Meaning = Meaning_packageVariableAccess | Meaning_packageFunctionAccess | Meaning_packageTypeAccess | Meaning_typeAccessAtConstructorCall | Meaning_packageNameSegmentAccess | Meaning_staticFieldAccess | Meaning_staticMethodAccess | Meaning_instanceFieldAccess | Meaning_instanceMethodAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
50
|
+
declare class Meaning_packageVariableAccess {
|
|
51
|
+
readonly variable: PackageVariableEntity;
|
|
52
|
+
readonly access: ComputedAccess;
|
|
53
|
+
readonly kind = "package-variable-access";
|
|
54
|
+
constructor(variable: PackageVariableEntity, access: ComputedAccess);
|
|
55
|
+
}
|
|
56
|
+
declare class Meaning_packageFunctionAccess {
|
|
57
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
58
|
+
readonly suitableOrSingleFunction: AccessedFunction | undefined;
|
|
59
|
+
readonly kind = "package-function-access";
|
|
60
|
+
constructor(candidates: readonly NotSubstitutedAccessedFunction[], suitableOrSingleFunction: AccessedFunction | undefined);
|
|
61
|
+
}
|
|
62
|
+
declare class Meaning_packageTypeAccess {
|
|
63
|
+
readonly candidates: readonly PackageTypeEntity[];
|
|
64
|
+
readonly suitableTypes: readonly types.Type[];
|
|
65
|
+
readonly isUsedAsValue: boolean;
|
|
66
|
+
readonly kind = "package-type-access";
|
|
67
|
+
get singleSuitableType(): types.Type | undefined;
|
|
68
|
+
constructor(candidates: readonly PackageTypeEntity[], suitableTypes: readonly types.Type[], isUsedAsValue: boolean);
|
|
69
|
+
}
|
|
70
|
+
declare class Meaning_typeAccessAtConstructorCall {
|
|
71
|
+
readonly typeCandidates: readonly PackageTypeEntity[];
|
|
72
|
+
readonly callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall;
|
|
73
|
+
readonly kind = "type-access-at-constructor-call";
|
|
74
|
+
constructor(typeCandidates: readonly PackageTypeEntity[], callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall);
|
|
75
|
+
}
|
|
76
|
+
declare class Meaning_packageNameSegmentAccess {
|
|
77
|
+
readonly packageTreeNode: PackageNameTreeNode;
|
|
78
|
+
readonly kind = "package-name-segment-access";
|
|
79
|
+
constructor(packageTreeNode: PackageNameTreeNode);
|
|
80
|
+
}
|
|
81
|
+
declare class Meaning_staticFieldAccess {
|
|
82
|
+
readonly type: types.Type;
|
|
83
|
+
readonly field: types.Field;
|
|
84
|
+
readonly access: ComputedAccess;
|
|
85
|
+
readonly kind = "static-field-access";
|
|
86
|
+
constructor(type: types.Type, field: types.Field, access: ComputedAccess);
|
|
87
|
+
}
|
|
88
|
+
declare class Meaning_staticMethodAccess {
|
|
89
|
+
readonly type: types.Type;
|
|
90
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
91
|
+
readonly suitableOrSingleFunction: AccessedFunction | undefined;
|
|
92
|
+
readonly kind = "static-method-access";
|
|
93
|
+
constructor(type: types.Type, candidates: readonly NotSubstitutedAccessedFunction[], suitableOrSingleFunction: AccessedFunction | undefined);
|
|
94
|
+
}
|
|
95
|
+
declare class Meaning_instanceFieldAccess {
|
|
96
|
+
readonly field: types.Field;
|
|
97
|
+
readonly access: ComputedAccess;
|
|
98
|
+
readonly kind = "instance-field-access";
|
|
99
|
+
constructor(field: types.Field, access: ComputedAccess);
|
|
100
|
+
}
|
|
101
|
+
declare class Meaning_instanceMethodAccess {
|
|
102
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
103
|
+
readonly suitableOrSingleFunction: AccessedFunction | undefined;
|
|
104
|
+
readonly kind = "instance-method-access";
|
|
105
|
+
constructor(candidates: readonly NotSubstitutedAccessedFunction[], suitableOrSingleFunction: AccessedFunction | undefined);
|
|
106
|
+
}
|
|
107
|
+
declare class Meaning_mixedAmbiguousAccess {
|
|
108
|
+
readonly entities: readonly Entity[];
|
|
109
|
+
readonly kind = "mixed-ambiguous-access";
|
|
110
|
+
constructor(entities: readonly Entity[]);
|
|
111
|
+
}
|
|
112
|
+
declare class Meaning_unresolved {
|
|
113
|
+
readonly kind = "unresolved";
|
|
114
|
+
}
|
|
115
|
+
export type MeaningStage1 = Meaning_packageVariableAccess | MeaningStage1_packageFunctionAccess | Meaning_packageTypeAccess | MeaningStage1_typeAccessAtCalleePosition | Meaning_packageNameSegmentAccess | Meaning_staticFieldAccess | MeaningStage1_staticMethodAccess | Meaning_instanceFieldAccess | MeaningStage1_instanceMethodAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
116
|
+
declare class MeaningStage1_typeAccessAtCalleePosition {
|
|
117
|
+
readonly types: readonly PackageTypeEntity[];
|
|
118
|
+
readonly kind = "type-access-at-callee-position";
|
|
119
|
+
constructor(types: readonly PackageTypeEntity[]);
|
|
120
|
+
}
|
|
121
|
+
declare class MeaningStage1_packageFunctionAccess {
|
|
122
|
+
readonly functions: readonly NotSubstitutedAccessedFunction[];
|
|
123
|
+
readonly kind = "package-function-access";
|
|
124
|
+
constructor(functions: readonly NotSubstitutedAccessedFunction[]);
|
|
125
|
+
}
|
|
126
|
+
declare class MeaningStage1_staticMethodAccess {
|
|
127
|
+
readonly type: types.Type;
|
|
128
|
+
readonly functions: readonly NotSubstitutedAccessedFunction[];
|
|
129
|
+
readonly kind = "static-method-access";
|
|
130
|
+
constructor(type: types.Type, functions: readonly NotSubstitutedAccessedFunction[]);
|
|
131
|
+
}
|
|
132
|
+
declare class MeaningStage1_instanceMethodAccess {
|
|
133
|
+
readonly functions: readonly NotSubstitutedAccessedFunction[];
|
|
134
|
+
readonly kind = "instance-method-access";
|
|
135
|
+
constructor(functions: readonly NotSubstitutedAccessedFunction[]);
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum ModifierFlags {
|
|
2
|
+
None = 0,
|
|
3
|
+
HiddenWithoutLevel = 1,
|
|
4
|
+
HiddenInType = 2,
|
|
5
|
+
HiddenInHierarchy = 4,
|
|
6
|
+
HiddenInFile = 8,
|
|
7
|
+
HiddenInPackage = 16,
|
|
8
|
+
Static = 32,
|
|
9
|
+
Abstract = 64,
|
|
10
|
+
Basic = 128,
|
|
11
|
+
Override = 256,
|
|
12
|
+
Async = 512,
|
|
13
|
+
Const = 1024,
|
|
14
|
+
First = 1,
|
|
15
|
+
Last = 1024,
|
|
16
|
+
NotComputed = 2048,
|
|
17
|
+
AnyHiddenModifier = 31,
|
|
18
|
+
HiddenInPackageOrWithoutLevel = 17,
|
|
19
|
+
HiddenInTypeOrWithoutLevel = 3
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { NamedTypeEntity, PackageAliasEntity } from '../../entities/index.js';
|
|
3
|
+
import { QualifiedName } from '../../tree/m/index.js';
|
|
4
|
+
import { EntityOrPackageNameTreeNode } from '../EntityOrPackageNameTreeNode.js';
|
|
5
|
+
import { PackageNameTreeNode } from '../ImportedPackageNameTree.js';
|
|
6
|
+
import { Analyzer } from './Analyzer.js';
|
|
7
|
+
export declare class NamedTypeResolver {
|
|
8
|
+
private readonly analyzer;
|
|
9
|
+
private readonly node;
|
|
10
|
+
private readonly diagnostics;
|
|
11
|
+
private readonly semanticContext_;
|
|
12
|
+
private get semanticContext();
|
|
13
|
+
constructor(analyzer: Analyzer, node: QualifiedName, diagnostics: DiagnosticAcceptor | undefined);
|
|
14
|
+
resolve(): NamedTypeResolutionResult;
|
|
15
|
+
private lookupTypeOrContainerWithTypes;
|
|
16
|
+
private findTypesOrContainersWithTypesInResolvedQualifier;
|
|
17
|
+
private findTypesOrContainersWithTypesInPackageAccessedViaAlias;
|
|
18
|
+
private findTypesOrContainersWithTypesInPackageNameSegment;
|
|
19
|
+
private convertPackageMember;
|
|
20
|
+
private createAmbiguousAccessDiagnostic;
|
|
21
|
+
}
|
|
22
|
+
export declare class NamedTypeResolutionResult {
|
|
23
|
+
readonly types: readonly NamedTypeEntity[];
|
|
24
|
+
readonly resolvedQualifiers: readonly ResolvedQualifier[];
|
|
25
|
+
readonly ambiguousDeclarations: readonly EntityOrPackageNameTreeNode[] | undefined;
|
|
26
|
+
constructor(types: readonly NamedTypeEntity[], resolvedQualifiers: readonly ResolvedQualifier[], ambiguousDeclarations: readonly EntityOrPackageNameTreeNode[] | undefined);
|
|
27
|
+
}
|
|
28
|
+
export type ResolvedQualifier = ResolvedQualifier_packageNameSegment | ResolvedQualifier_packageAlias | ResolvedQualifier_type;
|
|
29
|
+
export declare class ResolvedQualifier_packageNameSegment {
|
|
30
|
+
readonly packageTreeNode: PackageNameTreeNode;
|
|
31
|
+
readonly kind = "package-name-segment";
|
|
32
|
+
constructor(packageTreeNode: PackageNameTreeNode);
|
|
33
|
+
}
|
|
34
|
+
export declare class ResolvedQualifier_packageAlias {
|
|
35
|
+
readonly packageAlias: PackageAliasEntity;
|
|
36
|
+
readonly kind = "package-alias";
|
|
37
|
+
constructor(packageAlias: PackageAliasEntity);
|
|
38
|
+
}
|
|
39
|
+
export declare class ResolvedQualifier_type {
|
|
40
|
+
readonly candidates: readonly NamedTypeEntity[];
|
|
41
|
+
readonly suitableTypes: readonly NamedTypeEntity[];
|
|
42
|
+
readonly kind = "type";
|
|
43
|
+
constructor(candidates: readonly NamedTypeEntity[], suitableTypes: readonly NamedTypeEntity[]);
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { NamedTypeSpecifier } from '../../tree/m/index.js';
|
|
3
|
+
import * as types from '../../types/index.js';
|
|
4
|
+
import { EntityOrPackageNameTreeNode } from '../EntityOrPackageNameTreeNode.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
import { ResolvedQualifier } from './NamedTypeResolver.js';
|
|
7
|
+
export declare class NamedTypeSpecifierResolver {
|
|
8
|
+
private readonly analyzer;
|
|
9
|
+
private readonly node;
|
|
10
|
+
private readonly diagnostics;
|
|
11
|
+
constructor(analyzer: Analyzer, node: NamedTypeSpecifier, diagnostics: DiagnosticAcceptor | undefined);
|
|
12
|
+
resolve(): NamedTypeSpecifierResolutionResult;
|
|
13
|
+
}
|
|
14
|
+
export declare class NamedTypeSpecifierResolutionResult {
|
|
15
|
+
readonly type: types.Type | undefined;
|
|
16
|
+
readonly resolvedQualifiers: readonly ResolvedQualifier[];
|
|
17
|
+
readonly ambiguousDeclarations: readonly EntityOrPackageNameTreeNode[] | undefined;
|
|
18
|
+
constructor(type: types.Type | undefined, resolvedQualifiers: readonly ResolvedQualifier[], ambiguousDeclarations: readonly EntityOrPackageNameTreeNode[] | undefined);
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { ParameterEntity } from '../../entities/index.js';
|
|
3
|
+
import * as tree from '../../tree/m/index.js';
|
|
4
|
+
import * as types from '../../types/index.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
export declare class Resolver {
|
|
7
|
+
private readonly analyzer;
|
|
8
|
+
private readonly node;
|
|
9
|
+
private readonly diagnostics;
|
|
10
|
+
constructor(analyzer: Analyzer, node: tree.ObjectExpression, diagnostics: DiagnosticAcceptor | undefined);
|
|
11
|
+
resolve(): Meaning;
|
|
12
|
+
private invalidContextDiagnostic;
|
|
13
|
+
private staticContextDiagnostic;
|
|
14
|
+
}
|
|
15
|
+
export type Meaning = Meaning_objectAccess | Meaning_objectParameterAccess | Meaning_unresolved;
|
|
16
|
+
declare class Meaning_objectAccess {
|
|
17
|
+
readonly type: types.Type;
|
|
18
|
+
readonly kind = "object-access";
|
|
19
|
+
constructor(type: types.Type);
|
|
20
|
+
}
|
|
21
|
+
declare class Meaning_objectParameterAccess {
|
|
22
|
+
readonly parameter: ParameterEntity;
|
|
23
|
+
readonly kind = "object-parameter-access";
|
|
24
|
+
constructor(parameter: ParameterEntity);
|
|
25
|
+
}
|
|
26
|
+
declare class Meaning_unresolved {
|
|
27
|
+
readonly kind = "unresolved";
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Displayable, Name } from '../../common/index.js';
|
|
2
|
+
import { DiagnosticAcceptorWithArgumentFactory } from '../../diagnostic/Diagnostic.js';
|
|
3
|
+
import { TypeParameterEntity } from '../../entities/index.js';
|
|
4
|
+
import * as tree from '../../tree/m/index.js';
|
|
5
|
+
import * as types from '../../types/index.js';
|
|
6
|
+
import { DiagnosticArgumentFactory } from '../DiagnosticArgumentFactory.js';
|
|
7
|
+
import { NodeOrDiagnosticLocation } from '../NodeOrDiagnosticLocation.js';
|
|
8
|
+
import { Analyzer } from './Analyzer.js';
|
|
9
|
+
import * as matcher from './ArgumentsToParametersMatcher.js';
|
|
10
|
+
import { ExpressionAnalysisOptions } from './ExpressionAnalysisOptions.js';
|
|
11
|
+
import * as inferrer from './TypeArgumentInferrer.js';
|
|
12
|
+
export declare class OverloadResolver<TSignature extends ISignature<TParameter>, TParameter extends ISignatureParameter, TArgument extends Argument> {
|
|
13
|
+
private readonly analyzer;
|
|
14
|
+
private readonly mode;
|
|
15
|
+
private readonly signatures;
|
|
16
|
+
private readonly arguments_;
|
|
17
|
+
private readonly analysisOptions;
|
|
18
|
+
private readonly dataForTypeArgumentInference;
|
|
19
|
+
private readonly diagnostics;
|
|
20
|
+
private readonly nodesForDiagnostic;
|
|
21
|
+
constructor(analyzer: Analyzer, mode: ResolutionMode, signatures: readonly TSignature[], arguments_: readonly TArgument[], analysisOptions: ExpressionAnalysisOptions, dataForTypeArgumentInference: DataForTypeArgumentInference | undefined, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodesForDiagnostic: DiagnosticLocations | undefined);
|
|
22
|
+
resolveOverload(): ProcessedSignature<TSignature, TParameter, TArgument>[];
|
|
23
|
+
private areArgumentTypesAssignableToParameterTypes;
|
|
24
|
+
private tryChooseBestSignature;
|
|
25
|
+
private tryChooseBetterSignatureBasedOnParameterTypes;
|
|
26
|
+
private chooseBetterTargetType;
|
|
27
|
+
private tryChooseBetterSignatureBasedOnVariadicParameters;
|
|
28
|
+
private tryChooseBetterSignatureBasedOnPresenceOfTypeParameters;
|
|
29
|
+
private tryChooseBetterSignatureBasedOnParameterCount;
|
|
30
|
+
private functionLiteralCouldBeAssignableToType;
|
|
31
|
+
private reportAmbiguousAccessDiagnostic;
|
|
32
|
+
}
|
|
33
|
+
export interface ISignature<TParameter extends ISignatureParameter> extends matcher.ISignature<TParameter> {
|
|
34
|
+
getTypeParameters(): readonly TypeParameterEntity[];
|
|
35
|
+
getParameters(): readonly TParameter[];
|
|
36
|
+
getReturnType(): types.Type | undefined;
|
|
37
|
+
getOuterSubstitutions(): types.Substitutions | undefined;
|
|
38
|
+
toDisplayable(factory: DiagnosticArgumentFactory): Displayable;
|
|
39
|
+
}
|
|
40
|
+
export interface ISignatureParameter extends matcher.ISignatureParameter {
|
|
41
|
+
getType(): types.Type;
|
|
42
|
+
getIndex(): number;
|
|
43
|
+
}
|
|
44
|
+
export type ResolutionMode = ResolutionByExplicitArguments | ResolutionByTargetType;
|
|
45
|
+
export declare class ResolutionByExplicitArguments {
|
|
46
|
+
readonly kind = "by-explicit-arguments";
|
|
47
|
+
}
|
|
48
|
+
export declare class ResolutionByTargetType {
|
|
49
|
+
readonly targetType: types.FunctionType;
|
|
50
|
+
readonly kind = "by-target-type";
|
|
51
|
+
constructor(targetType: types.FunctionType);
|
|
52
|
+
}
|
|
53
|
+
export type Argument = SourceArgument | IntrinsicArgument;
|
|
54
|
+
export interface SourceArgument extends matcher.IArgument, inferrer.SourceArgument, IArgument {
|
|
55
|
+
readonly kind: 'source';
|
|
56
|
+
readonly expression: tree.Expression;
|
|
57
|
+
}
|
|
58
|
+
export declare class IntrinsicArgument implements matcher.IArgument, inferrer.IntrinsicArgument, IArgument {
|
|
59
|
+
readonly kind = "intrinsic";
|
|
60
|
+
readonly type: types.Type;
|
|
61
|
+
get name(): Name | undefined;
|
|
62
|
+
constructor(type: types.Type);
|
|
63
|
+
getDiagnosticLocation(): NodeOrDiagnosticLocation | undefined;
|
|
64
|
+
getType(analysisOptions_: ExpressionAnalysisOptions | undefined): types.Type;
|
|
65
|
+
}
|
|
66
|
+
interface IArgument {
|
|
67
|
+
getType(analysisOptions: ExpressionAnalysisOptions | undefined): types.Type;
|
|
68
|
+
}
|
|
69
|
+
export declare class SourceNodeArgument implements SourceArgument {
|
|
70
|
+
readonly kind = "source";
|
|
71
|
+
readonly node: tree.Argument;
|
|
72
|
+
readonly name: Name | undefined;
|
|
73
|
+
private readonly analyzer;
|
|
74
|
+
get expression(): tree.Expression;
|
|
75
|
+
constructor(analyzer: Analyzer, node: tree.Argument);
|
|
76
|
+
getDiagnosticLocation(): NodeOrDiagnosticLocation;
|
|
77
|
+
getType(analysisOptions: ExpressionAnalysisOptions | undefined): types.Type;
|
|
78
|
+
}
|
|
79
|
+
export declare class SourceExpressionArgument implements SourceArgument {
|
|
80
|
+
private readonly analyzer;
|
|
81
|
+
readonly expression: tree.Expression;
|
|
82
|
+
readonly kind = "source";
|
|
83
|
+
get name(): Name | undefined;
|
|
84
|
+
constructor(analyzer: Analyzer, expression: tree.Expression);
|
|
85
|
+
getDiagnosticLocation(): NodeOrDiagnosticLocation;
|
|
86
|
+
getType(analysisOptions: ExpressionAnalysisOptions | undefined): types.Type;
|
|
87
|
+
}
|
|
88
|
+
export declare class DataForTypeArgumentInference {
|
|
89
|
+
readonly specifiedTypeArguments: readonly types.Type[];
|
|
90
|
+
readonly targetType: types.Type | undefined;
|
|
91
|
+
constructor(specifiedTypeArguments: readonly types.Type[], targetType: types.Type | undefined);
|
|
92
|
+
}
|
|
93
|
+
export interface DiagnosticLocations {
|
|
94
|
+
readonly access: NodeOrDiagnosticLocation | undefined;
|
|
95
|
+
readonly typeArgumentClause: NodeOrDiagnosticLocation | undefined;
|
|
96
|
+
readonly argumentList: NodeOrDiagnosticLocation | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface ProcessedSignature<TSignature extends ISignature<TParameter>, TParameter extends ISignatureParameter, TArgument extends matcher.IArgument> {
|
|
99
|
+
readonly value: TSignature;
|
|
100
|
+
readonly matchResult: matcher.MatchResult<TParameter, TArgument>;
|
|
101
|
+
readonly typeArguments: readonly types.Type[] | undefined;
|
|
102
|
+
readonly isMatching: boolean;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Diagnostic } from '../../diagnostic/Diagnostic.js';
|
|
2
|
+
import { MethodEntity, TypeWithMembersOrExtensionEntity } from '../../entities/index.js';
|
|
3
|
+
import * as tree from '../../tree/m/index.js';
|
|
4
|
+
import * as types from '../../types/index.js';
|
|
5
|
+
import { Analyzer } from './Analyzer.js';
|
|
6
|
+
import { SemanticContext } from './semantic-context/SemanticContext.js';
|
|
7
|
+
export declare class OwnAndBaseConstructorCallsChecker {
|
|
8
|
+
private readonly analyzer;
|
|
9
|
+
private readonly constructorDeclarations;
|
|
10
|
+
private readonly typeEntity;
|
|
11
|
+
private readonly semanticContext;
|
|
12
|
+
constructor(analyzer: Analyzer, constructorDeclarations: readonly tree.MethodDeclaration[], typeEntity: TypeWithMembersOrExtensionEntity, semanticContext: SemanticContext);
|
|
13
|
+
check(): OwnAndBaseConstructorCallsCheckResult;
|
|
14
|
+
private addOwnConstructorCallOrReportCycleDiagnostic;
|
|
15
|
+
private getUnaliasedBaseObjectType;
|
|
16
|
+
private findAccessibleConstructorWithoutParameters;
|
|
17
|
+
}
|
|
18
|
+
export declare class OwnAndBaseConstructorCallsCheckResult {
|
|
19
|
+
readonly typeRequiresExplicitOwnOrBaseConstructorCalls: boolean;
|
|
20
|
+
readonly ownOrBaseConstructorCallInfos: ReadonlyMap<MethodEntity, OwnOrBaseConstructorCallInfo>;
|
|
21
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
22
|
+
constructor(typeRequiresExplicitOwnOrBaseConstructorCalls: boolean, ownOrBaseConstructorCallInfos: ReadonlyMap<MethodEntity, OwnOrBaseConstructorCallInfo>, diagnostics: readonly Diagnostic[]);
|
|
23
|
+
}
|
|
24
|
+
export declare class OwnOrBaseConstructorCallInfo {
|
|
25
|
+
readonly isOwnConstructorCall: boolean;
|
|
26
|
+
readonly constructor_: types.Method;
|
|
27
|
+
/**
|
|
28
|
+
* Отсутствие узла означает, что базовый конструктор без параметров не был вызван явно.
|
|
29
|
+
*/
|
|
30
|
+
readonly node: tree.CallExpression | undefined;
|
|
31
|
+
constructor(isOwnConstructorCall: boolean, constructor_: types.Method,
|
|
32
|
+
/**
|
|
33
|
+
* Отсутствие узла означает, что базовый конструктор без параметров не был вызван явно.
|
|
34
|
+
*/
|
|
35
|
+
node: tree.CallExpression | undefined);
|
|
36
|
+
}
|