@artel/artc 0.6.25253 → 0.6.25255
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 +12 -6
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +568 -365
- package/build/{chunk-6WZERC3X.js → chunk-R2AFVF7W.js} +2 -2
- package/build/{chunk-NEFP5U65.js → chunk-SSG7MY2R.js} +1 -1
- package/build/{chunk-3VAVX3J5.js → chunk-Y23FSWAN.js} +13016 -14906
- package/build/types/analysis/AccessedFunction.d.ts +11 -5
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/Analyzer.d.ts +116 -40
- package/build/types/analysis/ArgumentToParameterMatchResult.d.ts +1 -4
- package/build/types/analysis/ArgumentsToParametersMatcher.d.ts +9 -15
- package/build/types/analysis/AutotypeCallExpressionMeaning.d.ts +12 -6
- package/build/types/analysis/BaseExpressionMeaning.d.ts +43 -15
- package/build/types/analysis/CallExpressionMeaning.d.ts +41 -22
- package/build/types/analysis/ConstructorCallResolver.d.ts +22 -0
- package/build/types/analysis/DiagnosticCollector.d.ts +5 -9
- package/build/types/analysis/FunctionAccessResolver.d.ts +15 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +56 -22
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +3 -2
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +76 -27
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +0 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -0
- package/build/types/analysis/ObjectExpressionMeaning.d.ts +1 -0
- package/build/types/analysis/OperatorAccessResolver.d.ts +9 -0
- package/build/types/analysis/OverloadResolver.d.ts +91 -5
- package/build/types/analysis/ReturnTypeInferrer.d.ts +13 -0
- package/build/types/analysis/SubstitutedFunction.d.ts +10 -4
- package/build/types/analysis/TagMeaning.d.ts +16 -15
- package/build/types/analysis/TypeArgumentInferrer.d.ts +49 -0
- package/build/types/analysis/TypeNarrower.d.ts +6 -4
- package/build/types/analysis/TypeOverloadResolver.d.ts +4 -2
- package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -6
- package/build/types/analysis/UserDefinableUnaryOperatorResolver.d.ts +2 -2
- package/build/types/analysis/Utils.d.ts +2 -0
- package/build/types/analysis/index.d.ts +0 -2
- package/build/types/analysis/semantic-context/Declarations.d.ts +4 -4
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +1 -0
- package/build/types/api/Api.d.ts +0 -2
- package/build/types/common/ArrayUtils.d.ts +3 -2
- package/build/types/common/Cached.d.ts +2 -0
- package/build/types/common/Query.d.ts +1 -1
- package/build/types/common/TreeQuery.d.ts +1 -2
- package/build/types/diagnostic/Diagnostic.d.ts +7 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +180 -173
- package/build/types/entities/AliasTypeEntity.d.ts +1 -0
- package/build/types/entities/AliasedType.d.ts +2 -2
- package/build/types/entities/FunctionEntity.d.ts +6 -3
- package/build/types/entities/FunctionTypeEntity.d.ts +2 -1
- package/build/types/entities/PackageAliasEntity.d.ts +2 -2
- package/build/types/entities/StructuredTypeEntity.d.ts +1 -0
- package/build/types/entities/TypeParameterEntity.d.ts +1 -0
- package/build/types/entities/VariableEntity.d.ts +23 -11
- package/build/types/entities/VariantTypeEntity.d.ts +1 -0
- package/build/types/entities/index.d.ts +2 -1
- package/build/types/parser/CharacterCodes.d.ts +0 -8
- package/build/types/parser/Parser.d.ts +2 -2
- package/build/types/parser/TriviaInterner.d.ts +8 -0
- package/build/types/services/AddPropertyAssignmentService.d.ts +0 -7
- package/build/types/services/NodeSemanticInfo.d.ts +3 -1
- package/build/types/services/TreeUtils.d.ts +1 -1
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +9 -1
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -1
- package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -1
- package/build/types/tree/BaseNode.d.ts +26 -0
- package/build/types/tree/{green/Nodes.d.ts → Nodes.d.ts} +408 -356
- package/build/types/tree/{green/SyntaxToCode.d.ts → SyntaxToCode.d.ts} +1 -1
- package/build/types/tree/{green/Token.d.ts → Token.d.ts} +26 -10
- package/build/types/tree/{red/Utils.d.ts → Utils.d.ts} +4 -3
- package/build/types/tree/index.d.ts +10 -1
- package/build/types/ts-interop/Entities.d.ts +14 -0
- package/build/types/types/AliasType.d.ts +2 -2
- package/build/types/types/FunctionType.d.ts +2 -2
- package/build/types/types/IntersectionType.d.ts +2 -2
- package/build/types/types/ParameterType.d.ts +2 -2
- package/build/types/types/StructuredType.d.ts +2 -2
- package/build/types/types/Substitutions.d.ts +2 -2
- package/build/types/types/Type.d.ts +3 -3
- package/build/types/types/TypeMembers.d.ts +1 -0
- package/build/types/types/UnionType.d.ts +2 -2
- package/build/types/types/UnresolvedType.d.ts +2 -2
- package/build/types/types/VariantType.d.ts +2 -2
- package/package.json +1 -1
- package/build/types/analysis/ConstructorOverloadResolver.d.ts +0 -31
- package/build/types/analysis/FunctionOverloadResolver.d.ts +0 -21
- package/build/types/analysis/TargetTypeHint.d.ts +0 -5
- package/build/types/tree/green/BaseNode.d.ts +0 -14
- package/build/types/tree/green/Utils.d.ts +0 -2
- package/build/types/tree/green/index.d.ts +0 -8
- package/build/types/tree/red/BaseNode.d.ts +0 -16
- package/build/types/tree/red/Internal.d.ts +0 -2
- package/build/types/tree/red/Nodes.d.ts +0 -2271
- package/build/types/tree/red/Token.d.ts +0 -30
- package/build/types/tree/red/index.d.ts +0 -10
- /package/build/types/tree/{red/NodePath.d.ts → NodePath.d.ts} +0 -0
- /package/build/types/tree/{green/SyntaxFactory.d.ts → SyntaxFactory.d.ts} +0 -0
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import { Name } from '../common/index.js';
|
|
2
|
-
import { FunctionEntity, ParameterVariableEntity, TypeParameterEntity } from '../entities/index.js';
|
|
2
|
+
import { FunctionEntity, MethodEntity, PackageOrNestedFunctionEntity, ParameterVariableEntity, TypeParameterEntity } from '../entities/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
4
|
import { Analyzer } from './Analyzer.js';
|
|
5
5
|
import { SubstitutedFunction } from './SubstitutedFunction.js';
|
|
6
6
|
export type AccessedFunction = AccessedFunction_entity | AccessedFunction_typeMember | AccessedFunction_substitutedFunction;
|
|
7
|
+
export type NotSubstitutedAccessedFunction = AccessedFunction_entity | AccessedFunction_typeMember;
|
|
7
8
|
export declare class AccessedFunction_entity implements IAccessedFunction {
|
|
8
|
-
readonly value:
|
|
9
|
+
readonly value: PackageOrNestedFunctionEntity;
|
|
9
10
|
readonly kind = "entity";
|
|
10
|
-
|
|
11
|
+
get debuggerDisplay(): string;
|
|
12
|
+
constructor(value: PackageOrNestedFunctionEntity);
|
|
11
13
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
12
14
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
13
15
|
getReturnType(): types.Type;
|
|
14
|
-
getEntity():
|
|
16
|
+
getEntity(): PackageOrNestedFunctionEntity;
|
|
15
17
|
getName(): Name;
|
|
16
18
|
getSignatureType(analyzer: Analyzer): types.FunctionType;
|
|
19
|
+
applySubstitutions(analyzer: Analyzer, map: types.Substitutions): AccessedFunction;
|
|
17
20
|
}
|
|
18
21
|
export declare class AccessedFunction_typeMember implements IAccessedFunction {
|
|
19
22
|
readonly value: types.Method;
|
|
20
23
|
readonly kind = "type-member";
|
|
24
|
+
get debuggerDisplay(): string;
|
|
21
25
|
constructor(value: types.Method);
|
|
22
26
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
23
27
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
24
28
|
getReturnType(): types.Type;
|
|
25
|
-
getEntity():
|
|
29
|
+
getEntity(): MethodEntity;
|
|
26
30
|
getName(): Name;
|
|
27
31
|
getSignatureType(_analyzer: Analyzer): types.FunctionType;
|
|
32
|
+
applySubstitutions(_analyzer: Analyzer, substitutions: types.Substitutions): AccessedFunction;
|
|
28
33
|
}
|
|
29
34
|
export declare class AccessedFunction_substitutedFunction implements IAccessedFunction {
|
|
30
35
|
readonly value: SubstitutedFunction;
|
|
31
36
|
readonly kind = "substituted-function";
|
|
37
|
+
get debuggerDisplay(): string;
|
|
32
38
|
constructor(value: SubstitutedFunction);
|
|
33
39
|
getTypeParameters(): readonly TypeParameterEntity[];
|
|
34
40
|
getValueParameters(): readonly AccessedFunctionValueParameter[];
|
|
@@ -22,6 +22,7 @@ export declare class AnalyzedTranslationPackage {
|
|
|
22
22
|
private readonly _constructorSignatureTranslations;
|
|
23
23
|
private readonly _indexerSignatureTranslations;
|
|
24
24
|
private readonly _translatedTypeHeaders;
|
|
25
|
+
private readonly _typeTranslationByEntity;
|
|
25
26
|
constructor(_analyzer: Analyzer, _package: TranslationPackage, _targetTarget: PackageEntity);
|
|
26
27
|
getTargetPackage(): PackageEntity;
|
|
27
28
|
getPackageInTranslatedLanguage(): PackageEntity;
|
|
@@ -63,7 +64,7 @@ export declare class AnalyzedTranslationPackage {
|
|
|
63
64
|
private createTranslatedSubprogramSignatureForDefaultConstructor;
|
|
64
65
|
private createTranslatedTypeSignature;
|
|
65
66
|
private enumerateTranslationsDeclarations;
|
|
66
|
-
private
|
|
67
|
+
private getTypeEntityTranslationNode;
|
|
67
68
|
}
|
|
68
69
|
export declare class TranslatedPackageMembers {
|
|
69
70
|
private readonly _namedMembers;
|
|
@@ -19,26 +19,22 @@ import { ArgumentToParameterMatchResult, MatchResultValueParameter } from './Arg
|
|
|
19
19
|
import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.js';
|
|
20
20
|
import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
|
|
21
21
|
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
22
|
-
import * as constructorOverloadResolver from './ConstructorOverloadResolver.js';
|
|
23
22
|
import { DeclarationsUsageMap } from './DeclarationsUsageCounter.js';
|
|
24
23
|
import * as dereferenceExpressionMeaning from './DereferenceExpressionMeaning.js';
|
|
25
24
|
import { DiagnosticArgumentFactory } from './DiagnosticArgumentFactory.js';
|
|
26
|
-
import * as functionOverloadResolver from './FunctionOverloadResolver.js';
|
|
27
25
|
import * as identifierExpressionResolution from './IdentifierExpressionMeaning.js';
|
|
28
26
|
import { ImportedPackageNameTree, PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
|
29
27
|
import * as indexedAccessExpressionMeaning from './IndexedAccessExpressionMeaning.js';
|
|
30
28
|
import * as memberAccessExpressionResolution from './MemberAccessExpressionMeaning.js';
|
|
31
29
|
import { ModifierFlags } from './ModifierFlags.js';
|
|
32
30
|
import { NamedTypeSpecifierResolutionResult } from './NamedTypeSpecifierResolver.js';
|
|
33
|
-
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, SetterDeclaration, StructuredTypeDeclaration, TypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
31
|
+
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, RegularOrBlockFunctionLiteral, SetterDeclaration, StructuredTypeDeclaration, TypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
34
32
|
import * as objectExpressionMeaning from './ObjectExpressionMeaning.js';
|
|
35
33
|
import { OwnAndBaseConstructorCallsCheckResult } from './OwnAndBaseConstructorCallsChecker.js';
|
|
36
34
|
import { SourceFileMembers as ActualSourceFileMembers } from './SourceFileMembers.js';
|
|
37
35
|
import * as tagMeaning from './TagMeaning.js';
|
|
38
36
|
import * as tags from './Tags.js';
|
|
39
|
-
import { TargetTypeHint } from './TargetTypeHint.js';
|
|
40
37
|
import { TypeMemberImplementationCheckResult } from './TypeMemberImplementationChecker.js';
|
|
41
|
-
import * as typeOverloadResolver from './TypeOverloadResolver.js';
|
|
42
38
|
import * as controlFlow from './control-flow/index.js';
|
|
43
39
|
import { WellKnownDeclarations } from './index.js';
|
|
44
40
|
import * as semanticContext from './semantic-context/index.js';
|
|
@@ -72,20 +68,24 @@ export declare class Analyzer {
|
|
|
72
68
|
readonly owningPlainObjectModificationCheck: OwningPlainObjectModificationCheck;
|
|
73
69
|
readonly packageImports: PackageImports;
|
|
74
70
|
readonly typeUtils: TypeUtils;
|
|
71
|
+
readonly signatureComparer: SignatureComparer;
|
|
75
72
|
readonly conflictsCheck: ConflictsCheck;
|
|
73
|
+
readonly typeAssignabilityCheck: TypeAssignabilityCheck;
|
|
76
74
|
private readonly _tsInteropInputs;
|
|
77
75
|
private readonly _targetType;
|
|
78
|
-
private readonly _typeAssignabilityCheck;
|
|
79
76
|
private readonly _tsInterop;
|
|
80
77
|
private readonly _memberAccessExpressionResolutionResults;
|
|
78
|
+
private readonly _memberAccessExpressionResolutionResultsFirstStage;
|
|
81
79
|
private readonly _sourceFileMembers;
|
|
82
|
-
private readonly
|
|
80
|
+
private readonly _callExpressionResolutionResults;
|
|
83
81
|
private readonly _indexedAccessExpressionResolutionResults;
|
|
84
82
|
private readonly _dereferenceExpressionMeanings;
|
|
85
|
-
private readonly
|
|
83
|
+
private readonly _autotypeCallExpressionResolutionResults;
|
|
86
84
|
private readonly _identifierExpressionResolutionResults;
|
|
85
|
+
private readonly _identifierExpressionResolutionResultsFirstStage;
|
|
87
86
|
private readonly _tagResolutionResults;
|
|
88
87
|
private readonly _objectExpressionResolutionResults;
|
|
88
|
+
private readonly _baseExpressionResolutionResultsFirstStage;
|
|
89
89
|
private readonly _baseExpressionResolutionResults;
|
|
90
90
|
private readonly _namedTypeSpecifierResolutionResults;
|
|
91
91
|
private readonly _prefixUnaryExpressionOperatorResolutionResults;
|
|
@@ -96,7 +96,7 @@ export declare class Analyzer {
|
|
|
96
96
|
private readonly _extendedTypes;
|
|
97
97
|
private readonly _analyzedTranslationPackages;
|
|
98
98
|
private readonly _linkedMultiPlatformPackagesByPlatform;
|
|
99
|
-
private readonly
|
|
99
|
+
private readonly _isFunctionGeneratorCheckResults;
|
|
100
100
|
private readonly _namedDeclarationsUsageCountResults;
|
|
101
101
|
private readonly _packageAndStaticVariablesInitializationDiagnostics;
|
|
102
102
|
private readonly _controlFlowGraphs;
|
|
@@ -118,6 +118,7 @@ export declare class Analyzer {
|
|
|
118
118
|
isEnumeratorMethodSignature(entity: e.MethodEntity): boolean;
|
|
119
119
|
ifTypeEnumerableThenItemType(type: types.Type): types.Type | undefined;
|
|
120
120
|
ifTypeEnumeratorThenItemType(type: types.Type): types.Type | undefined;
|
|
121
|
+
ifTypeEnumerableOrEnumeratorThenItemType(type: types.Type): types.Type | undefined;
|
|
121
122
|
isTypeArrayOrReadonlyArray(type: types.Type): {
|
|
122
123
|
elementType: types.Type;
|
|
123
124
|
} | undefined;
|
|
@@ -129,27 +130,25 @@ export declare class Analyzer {
|
|
|
129
130
|
checkBlockInvokesAsyncMethods(node: tree.StatementBlock | tree.FunctionBlock): boolean;
|
|
130
131
|
getSyntacticAccessKind(node: tree.Expression): SyntacticAccessKind;
|
|
131
132
|
getTypeMemberEntityContainer(node: tree.TypeMemberDeclaration): e.TypeMemberEntityContainer;
|
|
132
|
-
getTargetTypeOfExpression(node: tree.Expression,
|
|
133
|
+
getTargetTypeOfExpression(node: tree.Expression, inferenceOptions?: InferenceOptions): types.Type | undefined;
|
|
133
134
|
getUnambiguousTargetFunctionType(targetType: types.Type | undefined): types.FunctionType | undefined;
|
|
134
135
|
getUnambiguousTargetArrayType(targetType: types.Type | undefined): types.Type | undefined;
|
|
135
136
|
getEnumeratorElementType(node: tree.Node): types.Type | undefined;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
resolveConstructorOverload<TCandidate extends constructorOverloadResolver.ICandidate<TValueParameter>, TValueParameter extends constructorOverloadResolver.IValueParameter>(candidates: readonly TCandidate[], args: readonly tree.Argument[]): readonly TCandidate[];
|
|
139
|
-
resolveTypeOverloadByArgumentCount<TCandidate extends typeOverloadResolver.ICandidate>(candidates: readonly TCandidate[], argumentCount: number): readonly TCandidate[];
|
|
140
|
-
resolveMemberAccessExpression(node: tree.MemberAccessExpression, targetTypeHint?: TargetTypeHint): memberAccessExpressionResolution.ResolutionResult;
|
|
137
|
+
resolveMemberAccessExpressionFirstStage(node: tree.MemberAccessExpression): memberAccessExpressionResolution.FirstStageResolutionResult;
|
|
138
|
+
resolveMemberAccessExpression(node: tree.MemberAccessExpression, inferenceOptions?: InferenceOptions): memberAccessExpressionResolution.ResolutionResult;
|
|
141
139
|
enumeratePackageImports(packageImportDirectives: Iterable<tree.PackageImportDirective>): Iterable<tree.PackageImport>;
|
|
142
140
|
getSourceFileMembers(node: tree.SourceFile): ActualSourceFileMembers;
|
|
143
|
-
|
|
144
|
-
getCallExpressionType(node: tree.CallExpression): types.Type;
|
|
141
|
+
resolveCallExpression(node: tree.CallExpression, inferenceOptions?: InferenceOptions): callExpressionMeaning.ResolutionResult;
|
|
145
142
|
getRespectiveParameter(node: tree.Argument): MatchResultValueParameter | undefined;
|
|
146
143
|
resolveIndexedAccessExpression(node: tree.IndexedAccessExpression): indexedAccessExpressionMeaning.ResolutionResult;
|
|
147
144
|
getDereferenceExpressionMeaning(node: tree.DereferenceExpression): dereferenceExpressionMeaning.Meaning;
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
resolveAutotypeCallExpression(node: tree.AutotypeCallExpression, inferenceOptions?: InferenceOptions): autotypeCallExpressionMeaning.ResolutionResult;
|
|
146
|
+
resolveIdentifierExpressionFirstStage(node: tree.IdentifierExpression): identifierExpressionResolution.FirstStageResolutionResult;
|
|
147
|
+
resolveIdentifierExpression(node: tree.IdentifierExpression, inferenceOptions?: InferenceOptions): identifierExpressionResolution.ResolutionResult;
|
|
150
148
|
resolveTag(node: tree.Tag): tagMeaning.ResolutionResult;
|
|
151
149
|
resolveObjectExpression(node: tree.ObjectExpression): objectExpressionMeaning.ResolutionResult;
|
|
152
|
-
|
|
150
|
+
resolveBaseExpressionFirstStage(node: tree.BaseExpression): baseExpressionMeaning.FirstStageResolutionsResult;
|
|
151
|
+
resolveBaseExpression(node: tree.BaseExpression): baseExpressionMeaning.ResolutionResult;
|
|
153
152
|
/**
|
|
154
153
|
* Проверяет, является ли выражение цепочкой доступов через `?`, заканчивающейся выражением, тип которого допускает
|
|
155
154
|
* `пусто`.
|
|
@@ -199,7 +198,14 @@ export declare class Analyzer {
|
|
|
199
198
|
checkExpressionDenotesPackageNameSegment(expression: tree.Expression): {
|
|
200
199
|
packageTreeNode: PackageNameTreeNode;
|
|
201
200
|
} | undefined;
|
|
202
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Функция считается генератором, если:
|
|
203
|
+
* - Использует команду `выдать`.
|
|
204
|
+
* - Не использует команду `выдать`, но её возвращаемым типом является `Перебираемый` или `Перебор`, она не
|
|
205
|
+
* возвращает значение и не использует переменную `результат` (использование команды `вернуть` без указания
|
|
206
|
+
* возвращаемого значения допустимо). В таком случае это генератор, не возвращающий ни одного элемента.
|
|
207
|
+
*/
|
|
208
|
+
isFunctionGenerator(node: FunctionDeclaration): boolean;
|
|
203
209
|
enumerateAspects(type: types.Type): Iterable<types.StructuredType>;
|
|
204
210
|
checkTypeIsBasedOnAspect(type: types.Type, aspectEntity: e.StructuredTypeEntity): boolean;
|
|
205
211
|
resolvePrefixUnaryExpressionUserDefinableOperator(node: tree.PrefixUnaryExpression): WithDiagnostics<types.Operator>;
|
|
@@ -293,7 +299,7 @@ export declare class Analyzer {
|
|
|
293
299
|
basicMethodOfOriginalType: e.MethodEntity;
|
|
294
300
|
} | undefined;
|
|
295
301
|
getControlFlowGraph(sourceFile: project.SourceFile): controlFlow.GraphBuildResult;
|
|
296
|
-
createAmbiguousEntityAccessDiagnostic(entities: readonly e.Entity[], node: tree.Node): Diagnostic;
|
|
302
|
+
createAmbiguousEntityAccessDiagnostic(entities: readonly e.Entity[], node: tree.Node, diagnosticArgumentFactory?: DiagnosticArgumentFactory): Diagnostic;
|
|
297
303
|
createAmbiguousFunctionAccessDiagnostic(functions: readonly AccessedFunction[], node: tree.Node): Diagnostic;
|
|
298
304
|
createAmbiguousTypeMemberAccessDiagnostic(members: readonly types.TypeMember[], node: tree.Node): Diagnostic;
|
|
299
305
|
createAmbiguousNamedScopeDeclarationAccessDiagnostic(declarations: readonly semanticContext.NamedDeclaration[], node: tree.Node): Diagnostic;
|
|
@@ -313,6 +319,12 @@ export declare class Analyzer {
|
|
|
313
319
|
isConstructorCallingOwnConstructor(node: tree.ConstructorDeclaration): boolean;
|
|
314
320
|
createDiagnosticArgumentFactoryWithinPackage(entity: e.PackageEntity): DiagnosticArgumentFactory;
|
|
315
321
|
createDiagnosticArgumentFactoryWithinEntityContext(context: e.EntityContext): DiagnosticArgumentFactory;
|
|
322
|
+
ifCalleeThenCallExpression(node: tree.Expression): tree.CallExpression | undefined;
|
|
323
|
+
getNodeForAmbiguousAccessDiagnostic(access: tree.Expression): tree.Node;
|
|
324
|
+
isPossibleWrappedTargetTypeDependentFunctionLiteral(node: tree.Expression): boolean;
|
|
325
|
+
isTargetTypeDependentFunctionLiteral(node: tree.Expression): node is RegularOrBlockFunctionLiteral;
|
|
326
|
+
checkTypeArgumentCount(typeArgumentCount: number, typeParameters: readonly e.TypeParameterEntity[], diagnostics?: DiagnosticAcceptor, nodeForDiagnostic?: tree.Node): boolean;
|
|
327
|
+
checkTypeCanBeUsedAsValue(typeAccess: tree.Expression): boolean;
|
|
316
328
|
private createTsInterop;
|
|
317
329
|
}
|
|
318
330
|
export declare class TsInteropInputs {
|
|
@@ -348,14 +360,15 @@ declare class Type {
|
|
|
348
360
|
private readonly _unionTypeSpecifierTypes;
|
|
349
361
|
private readonly _intersectionTypeSpecifierTypes;
|
|
350
362
|
private readonly _functionLiteralTypes;
|
|
351
|
-
private readonly
|
|
363
|
+
private readonly _nodesForWhichReturnTypeInferenceDiagnosticHasBeenReported;
|
|
352
364
|
constructor(_analyzer: Analyzer);
|
|
353
|
-
ofExpression(node: tree.Expression,
|
|
365
|
+
ofExpression(node: tree.Expression, inferenceOptions?: InferenceOptions): types.Type;
|
|
354
366
|
ofTypeSpecifier(node: tree.TypeSpecifier): types.Type;
|
|
355
367
|
ofAccessedFunction(accessedFunction: AccessedFunction): types.Type;
|
|
356
368
|
ofAccessedOperator(operator: types.Operator): types.Type;
|
|
357
|
-
|
|
358
|
-
|
|
369
|
+
ofRegularOrBlockFunctionLiteral(node: RegularOrBlockFunctionLiteral, inferenceOptions?: InferenceOptions): types.FunctionType;
|
|
370
|
+
ofFunctionBlockLiteral(node: tree.FunctionBlockLiteral, inferenceOptions?: InferenceOptions): types.FunctionType;
|
|
371
|
+
ofFunctionLiteral(node: tree.FunctionLiteral, inferenceOptions?: InferenceOptions): types.FunctionType;
|
|
359
372
|
private ofArrayLiteral;
|
|
360
373
|
private ofAssertionExpression;
|
|
361
374
|
private ofAssumptionExpression;
|
|
@@ -396,9 +409,11 @@ declare class Type {
|
|
|
396
409
|
private ofUnionTypeSpecifier;
|
|
397
410
|
private ofIntersectionTypeSpecifier;
|
|
398
411
|
private ofInvalidTypeSpecifier;
|
|
399
|
-
private
|
|
400
|
-
private
|
|
401
|
-
private
|
|
412
|
+
private createFunctionLiteralType;
|
|
413
|
+
private createFunctionBlockLiteralType;
|
|
414
|
+
private inferAndCacheReturnTypeOfRegularOrBlockFunctionLiteral;
|
|
415
|
+
private replaceReturnTypeOfFunctionType;
|
|
416
|
+
private reportReturnTypeCanNotBeInferredDiagnostic;
|
|
402
417
|
private getNarrowedTypeIfNarrowableReference;
|
|
403
418
|
}
|
|
404
419
|
declare class ReturnType {
|
|
@@ -416,6 +431,7 @@ declare class ReturnType {
|
|
|
416
431
|
ofFieldGetterDeclaration(node: tree.FieldGetterDeclaration): types.Type;
|
|
417
432
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): types.Type;
|
|
418
433
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): types.Type;
|
|
434
|
+
ofFunctionDeclaration(node: FunctionDeclaration): types.Type;
|
|
419
435
|
}
|
|
420
436
|
declare class Entity {
|
|
421
437
|
private readonly _analyzer;
|
|
@@ -492,18 +508,12 @@ declare class Entity {
|
|
|
492
508
|
ofPackageImport(node: tree.PackageImport): e.PackageAliasEntity;
|
|
493
509
|
ofTypeWithMembersDeclaration(node: TypeWithMembersDeclaration): e.TypeEntityWithMembers;
|
|
494
510
|
ofTranslationTextTemplateParameter(node: tree.TranslationTextTemplateParameter): e.TranslationTextTemplateParameterEntity;
|
|
495
|
-
ofTextLiteral(node: tree.TextLiteral): e.LocalizableSimpleTextEntity;
|
|
496
|
-
ofTextTemplateLiteral(node: tree.TextTemplateLiteral): e.LocalizableTextTemplateEntity;
|
|
497
|
-
private ensureLocalizableTextEntitiesCreated;
|
|
498
511
|
private getContainingPackageLoadedFromDts;
|
|
499
512
|
private createComputedFieldEntities;
|
|
500
513
|
private createDereferenceOperatorEntities;
|
|
501
514
|
private createIndexerEntities;
|
|
502
515
|
private areIndexedElementAccessorDeclarationsEqual;
|
|
503
516
|
}
|
|
504
|
-
type EntityClassMembers = Entity[keyof Entity];
|
|
505
|
-
type GetNodesFromMethodsParameter<T> = T extends (node: infer TNode) => e.Entity ? (TNode extends tree.Node ? TNode : never) : never;
|
|
506
|
-
export type NodeCorrespondingToEntity = GetNodesFromMethodsParameter<EntityClassMembers>;
|
|
507
517
|
declare class ResultLocalVariableEntity {
|
|
508
518
|
private readonly _analyzer;
|
|
509
519
|
private readonly _entities;
|
|
@@ -518,6 +528,7 @@ declare class ResultLocalVariableEntity {
|
|
|
518
528
|
ofFieldGetterDeclaration(node: tree.FieldGetterDeclaration): e.LocalVariableEntity;
|
|
519
529
|
ofIndexedElementGetterDeclaration(node: tree.IndexedElementGetterDeclaration): e.LocalVariableEntity;
|
|
520
530
|
ofDereferencedVariableGetterDeclaration(node: tree.DereferencedVariableGetterDeclaration): e.LocalVariableEntity;
|
|
531
|
+
ofFunctionDeclaration(node: FunctionDeclaration): e.LocalVariableEntity;
|
|
521
532
|
private createResultLocalVariableEntity;
|
|
522
533
|
}
|
|
523
534
|
declare class ValueLocalVariableEntity {
|
|
@@ -528,6 +539,7 @@ declare class ValueLocalVariableEntity {
|
|
|
528
539
|
ofFieldSetterDeclaration(node: tree.FieldSetterDeclaration): e.LocalVariableEntity;
|
|
529
540
|
ofIndexedElementSetterDeclaration(node: tree.IndexedElementSetterDeclaration): e.LocalVariableEntity;
|
|
530
541
|
ofDereferencedVariableSetterDeclaration(node: tree.DereferencedVariableSetterDeclaration): e.LocalVariableEntity;
|
|
542
|
+
private createValueLocalVariableEntity;
|
|
531
543
|
}
|
|
532
544
|
declare class OverriddenMember {
|
|
533
545
|
private readonly _analyzer;
|
|
@@ -662,6 +674,32 @@ declare class OwningPlainObjectModificationCheck {
|
|
|
662
674
|
private checkReceiverModifiesPlainObjectRecursively;
|
|
663
675
|
private nodeBelongsToPlainObjectDeclaration;
|
|
664
676
|
}
|
|
677
|
+
declare class TypeAssignabilityCheck {
|
|
678
|
+
private readonly _analyzer;
|
|
679
|
+
constructor(_analyzer: Analyzer);
|
|
680
|
+
isTypeAssignableTo(source: types.Type, target: types.Type): boolean;
|
|
681
|
+
getAssignabilityFlags(source: types.Type, target: types.Type): TypeAssignabilityFlags;
|
|
682
|
+
/**
|
|
683
|
+
* Определяет, насколько данный вид совместимости типов более предпочтителен при определении совместимости союзного
|
|
684
|
+
* тип с другим, а также при определении наиболее подходящей перегрузки. Чем выше счёт - тем вид более предпочтителен.
|
|
685
|
+
*/
|
|
686
|
+
getSingleFlagScore(flag: TypeAssignabilityFlags): number;
|
|
687
|
+
getLowestFlagsScore(flags: TypeAssignabilityFlags): number;
|
|
688
|
+
private getAssignabilityFlagsForStructuredTypes;
|
|
689
|
+
/**
|
|
690
|
+
* @example
|
|
691
|
+
* ```artel
|
|
692
|
+
* пусть а = операция(п: Текст): Объект { }
|
|
693
|
+
* пусть б = операция(п: Объект): Текст { }
|
|
694
|
+
*
|
|
695
|
+
* а = б // Корректно
|
|
696
|
+
* б = а // Ошибка
|
|
697
|
+
* ```
|
|
698
|
+
*/
|
|
699
|
+
private getAssignabilityFlagsForFunctionTypes;
|
|
700
|
+
private areNewFlagsBetter;
|
|
701
|
+
private getFlagCount;
|
|
702
|
+
}
|
|
665
703
|
export declare enum TypeAssignabilityFlags {
|
|
666
704
|
None = 0,
|
|
667
705
|
/**
|
|
@@ -712,7 +750,10 @@ declare class TypeUtils {
|
|
|
712
750
|
removeDerivedTypesInPlace(types: types.Type[]): void;
|
|
713
751
|
getBaseOrAliasedTypes(type: types.Type): readonly types.Type[];
|
|
714
752
|
getPossiblyAliasedBaseObjectType(type: types.Type): types.Type | undefined;
|
|
753
|
+
getPossiblyAliasedBaseAspectTypes(type: types.Type): readonly types.Type[] | undefined;
|
|
754
|
+
getBaseObjectTypeOrAliasedType(type: types.Type): types.Type | undefined;
|
|
715
755
|
getBaseAndAliasedTypesRecursively(type: types.Type): readonly types.Type[];
|
|
756
|
+
isTypeDerivedFromOrEqualsTo(source: types.Type, target: types.Type, considerTypeArguments?: boolean): boolean;
|
|
716
757
|
private collectBaseAndAliasedTypesRecursively;
|
|
717
758
|
private getBaseTypesForCommonTypesSearch;
|
|
718
759
|
private addTypeAndCollectAllBaseTypes;
|
|
@@ -720,10 +761,37 @@ declare class TypeUtils {
|
|
|
720
761
|
private getFlattenedConstituentTypesForCommonTypesSearch;
|
|
721
762
|
private flattenTypeParameterConstraint;
|
|
722
763
|
}
|
|
723
|
-
declare class
|
|
764
|
+
declare class SignatureComparer {
|
|
724
765
|
private readonly _analyzer;
|
|
725
766
|
private _stubParameterTypes;
|
|
726
767
|
constructor(_analyzer: Analyzer);
|
|
768
|
+
areEqualFunctionEntities(function1: e.FunctionEntity, function2: e.FunctionEntity, options: SignatureComparisonOptions): boolean;
|
|
769
|
+
/**
|
|
770
|
+
* Метод аналогичен методу {@link areEqualFunctionEntities}.
|
|
771
|
+
*/
|
|
772
|
+
areEqualMethods(method1: types.Method, method2: types.Method, options: SignatureComparisonOptions): boolean;
|
|
773
|
+
/**
|
|
774
|
+
* Проверяет, конфликтуют две сущности, имеющие параметры, но не имеющие параметры типа.
|
|
775
|
+
*
|
|
776
|
+
* Отношение "сущности, имеющие только параметры, конфликтуют" является транзитивным.
|
|
777
|
+
*/
|
|
778
|
+
areEqualSignaturesWithoutTypeParameters(entity1: EntityWithoutTypeParametersInSignature, entity2: EntityWithoutTypeParametersInSignature): boolean;
|
|
779
|
+
areEqualTypeMemberSignaturesWithoutTypeParameters(member1: TypeMemberWithoutTypeParametersInSignature, member2: TypeMemberWithoutTypeParametersInSignature): boolean;
|
|
780
|
+
doTypeParameterCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
781
|
+
private areEqualParameters;
|
|
782
|
+
private areEqualTypeMemberParameters;
|
|
783
|
+
private createSubstitutionsWithStubTypes;
|
|
784
|
+
}
|
|
785
|
+
export declare enum SignatureComparisonOptions {
|
|
786
|
+
None = 0,
|
|
787
|
+
CompareNames = 1,
|
|
788
|
+
CompareReturnTypes = 2,
|
|
789
|
+
CheckTypeParameterCountIntersection = 4
|
|
790
|
+
}
|
|
791
|
+
declare class ConflictsCheck {
|
|
792
|
+
private readonly _analyzer;
|
|
793
|
+
private static readonly _signatureComparisonOptions;
|
|
794
|
+
constructor(_analyzer: Analyzer);
|
|
727
795
|
/**
|
|
728
796
|
* Проверяет, конфликтуют ли две функции, т.е. могут ли такие функции находиться в одной области видимости.
|
|
729
797
|
* Метод не сравнивает имена.
|
|
@@ -760,10 +828,6 @@ declare class ConflictsCheck {
|
|
|
760
828
|
* {@link doFunctionSignaturesConflict}).
|
|
761
829
|
*/
|
|
762
830
|
doPackageTypesConflict(type1: e.PackageTypeEntity, type2: e.PackageTypeEntity): boolean;
|
|
763
|
-
doTypeArgumentCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
764
|
-
private doParametersConflict;
|
|
765
|
-
private doTypeMemberParametersConflict;
|
|
766
|
-
private createSubstitutionMapWithStubTypes;
|
|
767
831
|
}
|
|
768
832
|
export type EntityWithoutTypeParametersInSignature = e.ConstructorEntity | e.DestructorEntity | e.OperatorEntity | e.IndexerEntity;
|
|
769
833
|
export type TypeMemberWithoutTypeParametersInSignature = types.Constructor | types.Destructor | types.Operator | types.Indexer;
|
|
@@ -771,6 +835,7 @@ export declare class ExpressionDenotesFunctionCheckResult {
|
|
|
771
835
|
readonly candidates: readonly AccessedFunction[];
|
|
772
836
|
readonly suitableFunctions: readonly AccessedFunction[];
|
|
773
837
|
get singleSuitableFunction(): AccessedFunction | undefined;
|
|
838
|
+
get singleFunction(): AccessedFunction | undefined;
|
|
774
839
|
constructor(candidates: readonly AccessedFunction[], suitableFunctions: readonly AccessedFunction[]);
|
|
775
840
|
}
|
|
776
841
|
export declare class ExpressionDenotesOperatorCheckResult {
|
|
@@ -790,4 +855,15 @@ export declare class DeclaredTypeMemberEntities {
|
|
|
790
855
|
get namedMembers(): e.NamedTypeMemberEntity[];
|
|
791
856
|
constructor(variables: readonly e.FieldEntity[], methods: readonly e.MethodEntity[], operators: readonly e.OperatorEntity[], constructors: readonly e.ConstructorEntity[], destructors: readonly e.DestructorEntity[], indexers: readonly e.SourceIndexerEntity[], dereferenceOperators: readonly e.DereferenceOperatorEntity[]);
|
|
792
857
|
}
|
|
858
|
+
export declare class InferenceOptions {
|
|
859
|
+
readonly targetType: types.Type | undefined;
|
|
860
|
+
readonly allowCaching: boolean;
|
|
861
|
+
readonly allowReportingDiagnostics: boolean;
|
|
862
|
+
constructor(targetType: types.Type | undefined, allowCaching: boolean, allowReportingDiagnostics: boolean);
|
|
863
|
+
static withTargetType(options: InferenceOptions | undefined, targetType: types.Type | undefined): InferenceOptions;
|
|
864
|
+
withTargetType(targetType: types.Type | undefined): InferenceOptions;
|
|
865
|
+
withAllowCaching(allowCaching: boolean): InferenceOptions;
|
|
866
|
+
withAllowReportingDiagnostics(allowReportingDiagnostics: boolean): InferenceOptions;
|
|
867
|
+
withTargetTypeAndAllowCaching(targetType: types.Type | undefined, allowCaching: boolean): InferenceOptions;
|
|
868
|
+
}
|
|
793
869
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
1
|
import { ParameterVariableEntity } from '../entities/index.js';
|
|
3
2
|
import * as tree from '../tree/index.js';
|
|
4
3
|
import * as types from '../types/index.js';
|
|
@@ -16,9 +15,7 @@ export declare class ArgumentToParameterMatchResult {
|
|
|
16
15
|
}
|
|
17
16
|
export declare class MatchResult {
|
|
18
17
|
readonly parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>;
|
|
19
|
-
|
|
20
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
21
|
-
constructor(parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>, unmatchedParameters: readonly MatchResultValueParameter[], diagnostics: readonly Diagnostic[]);
|
|
18
|
+
constructor(parameterByArgument: ReadonlyMap<tree.Argument, MatchResultValueParameter>);
|
|
22
19
|
}
|
|
23
20
|
export declare class MatchResultValueParameter {
|
|
24
21
|
readonly entity: ParameterVariableEntity;
|
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
import { Name } from '../common/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { DiagnosticAcceptor, DiagnosticLocation } from '../diagnostic/Diagnostic.js';
|
|
3
3
|
import * as tree from '../tree/index.js';
|
|
4
|
-
import * as types from '../types/index.js';
|
|
5
4
|
import { Analyzer } from './index.js';
|
|
6
5
|
export declare class ArgumentToParameterMatcher<TSignature extends ISignature<TParameter>, TParameter extends ISignatureParameter, TArgument extends IArgument> {
|
|
7
6
|
private readonly _analyzer;
|
|
8
7
|
private readonly _signature;
|
|
9
8
|
private readonly _arguments;
|
|
10
|
-
|
|
9
|
+
private readonly _diagnostics;
|
|
10
|
+
private readonly _nodeForUnmatchedRequiredParametersDiagnostic;
|
|
11
|
+
constructor(_analyzer: Analyzer, _signature: TSignature, _arguments: readonly TArgument[], _diagnostics: DiagnosticAcceptor | undefined, _nodeForUnmatchedRequiredParametersDiagnostic: tree.Node | undefined);
|
|
11
12
|
match(): MatchResult<TParameter, TArgument>;
|
|
12
13
|
private matchArgumentsToParameters;
|
|
13
|
-
private
|
|
14
|
-
private getArgumentType;
|
|
14
|
+
private reportArgumentDiagnostic;
|
|
15
15
|
}
|
|
16
16
|
export declare class MatchResult<TParameter extends ISignatureParameter, TArgument extends IArgument> {
|
|
17
17
|
readonly mapping: ReadonlyMap<TArgument, TParameter>;
|
|
18
|
-
readonly
|
|
19
|
-
|
|
20
|
-
readonly hasTypeAssignabilityErrors: boolean;
|
|
21
|
-
get isMatching(): boolean;
|
|
22
|
-
constructor(mapping: ReadonlyMap<TArgument, TParameter>, unmatchedRequiredParameters: readonly TParameter[], argumentArrangementDiagnostics: readonly Diagnostic[], hasTypeAssignabilityErrors: boolean);
|
|
18
|
+
readonly isMatching: boolean;
|
|
19
|
+
constructor(mapping: ReadonlyMap<TArgument, TParameter>, isMatching: boolean);
|
|
23
20
|
}
|
|
24
21
|
export interface ISignature<TParameter extends ISignatureParameter> {
|
|
25
22
|
getParameters(): readonly TParameter[];
|
|
26
23
|
}
|
|
27
24
|
export interface ISignatureParameter {
|
|
28
25
|
getName(): Name | undefined;
|
|
29
|
-
getType(): types.Type;
|
|
30
26
|
isOptional(): boolean;
|
|
31
27
|
}
|
|
32
28
|
export interface IArgument {
|
|
33
|
-
|
|
34
|
-
getName(): Name | undefined;
|
|
29
|
+
readonly name: Name | undefined;
|
|
35
30
|
getDiagnosticLocation(): DiagnosticLocation | undefined;
|
|
36
31
|
}
|
|
37
32
|
export declare class SourceArgument implements IArgument {
|
|
38
33
|
private readonly _analyzer;
|
|
39
34
|
readonly node: tree.Argument;
|
|
35
|
+
readonly name: Name | undefined;
|
|
40
36
|
constructor(_analyzer: Analyzer, node: tree.Argument);
|
|
41
|
-
getExpression(): tree.Expression;
|
|
42
|
-
getName(): Name | undefined;
|
|
43
37
|
getDiagnosticLocation(): DiagnosticLocation;
|
|
44
38
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import { AutotypeCallExpression } from '../tree/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
|
-
import { Analyzer,
|
|
4
|
+
import { Analyzer, InferenceOptions } from './index.js';
|
|
5
5
|
export declare class Resolver {
|
|
6
6
|
private readonly _analyzer;
|
|
7
7
|
readonly _node: AutotypeCallExpression;
|
|
8
|
-
readonly
|
|
9
|
-
constructor(_analyzer: Analyzer, _node: AutotypeCallExpression,
|
|
10
|
-
resolve():
|
|
8
|
+
readonly _inferenceOptions: InferenceOptions | undefined;
|
|
9
|
+
constructor(_analyzer: Analyzer, _node: AutotypeCallExpression, _inferenceOptions: InferenceOptions | undefined);
|
|
10
|
+
resolve(): ResolutionResult;
|
|
11
|
+
}
|
|
12
|
+
export declare class ResolutionResult {
|
|
13
|
+
readonly meaning: Meaning;
|
|
14
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
15
|
+
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
16
|
+
static unresolved(diagnostics: readonly Diagnostic[] | undefined): ResolutionResult;
|
|
11
17
|
}
|
|
12
18
|
export type Meaning = Meaning_constructorCall | Meaning_unresolved;
|
|
13
19
|
declare class Meaning_constructorCall {
|
|
@@ -22,6 +28,8 @@ declare class Meaning_constructorCall {
|
|
|
22
28
|
readonly candidates: readonly types.Constructor[];
|
|
23
29
|
readonly suitableConstructors: readonly types.Constructor[];
|
|
24
30
|
readonly kind = "constructor-call";
|
|
31
|
+
get singleSuitableConstructor(): types.Constructor | undefined;
|
|
32
|
+
get singleConstructor(): types.Constructor | undefined;
|
|
25
33
|
constructor(
|
|
26
34
|
/**
|
|
27
35
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
@@ -33,8 +41,6 @@ declare class Meaning_constructorCall {
|
|
|
33
41
|
type: types.Type, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[]);
|
|
34
42
|
}
|
|
35
43
|
declare class Meaning_unresolved {
|
|
36
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
37
44
|
readonly kind = "unresolved";
|
|
38
|
-
constructor(diagnostics: readonly Diagnostic[]);
|
|
39
45
|
}
|
|
40
46
|
export {};
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import * as tree from '../tree/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
|
+
import { AccessedFunction } from './AccessedFunction.js';
|
|
4
5
|
import { Analyzer } from './Analyzer.js';
|
|
5
|
-
|
|
6
|
-
* "основа" не является самостоятельным выражением и может использоваться только в следующих конструкциях:
|
|
7
|
-
* 1. `основа()` - в конструкторе для вызова базового конструктора или в методе для вызова базового метода.
|
|
8
|
-
* 2. `основа.поле` (`основа.метод`) - в любом выражении в контексте типа, имеющего базовый тип.
|
|
9
|
-
* 3. `основа[]` - аналогично п. 2.
|
|
10
|
-
* 4. `основа^` - аналогично п. 2.
|
|
11
|
-
* 5. `(основа как БазовыйАспект).поле`, `(основа как БазовыйАспект)[]`, `(основа как БазовыйАспект)^` - для доступа к
|
|
12
|
-
* реализации по умолчанию члена базового аспекта.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Resolver {
|
|
6
|
+
export declare class FirstStageResolver {
|
|
15
7
|
private readonly _analyzer;
|
|
16
8
|
private readonly _node;
|
|
17
9
|
constructor(analyzer: Analyzer, node: tree.BaseExpression);
|
|
18
|
-
resolve():
|
|
10
|
+
resolve(): FirstStageResolutionsResult;
|
|
19
11
|
private resolveBaseConstructorOrMethodAccess;
|
|
20
12
|
private resolveBaseConstructorAccess;
|
|
21
13
|
private resolveBaseMethodAccess;
|
|
@@ -25,11 +17,29 @@ export declare class Resolver {
|
|
|
25
17
|
private getBaseOrAliasedType;
|
|
26
18
|
private getContainingTypeMemberDeclaration;
|
|
27
19
|
}
|
|
28
|
-
|
|
20
|
+
/**
|
|
21
|
+
* "основа" не является самостоятельным выражением и может использоваться только в следующих конструкциях:
|
|
22
|
+
* 1. `основа()` - в конструкторе для вызова базового конструктора или в методе для вызова базового метода.
|
|
23
|
+
* 2. `основа.поле` (`основа.метод`) - в любом выражении в контексте типа, имеющего базовый тип.
|
|
24
|
+
* 3. `основа[]` - аналогично п. 2.
|
|
25
|
+
* 4. `основа^` - аналогично п. 2.
|
|
26
|
+
* 5. `(основа как БазовыйАспект).поле`, `(основа как БазовыйАспект)[]`, `(основа как БазовыйАспект)^` - для доступа к
|
|
27
|
+
* реализации по умолчанию члена базового аспекта.
|
|
28
|
+
*/
|
|
29
|
+
export declare class SecondStageResolver {
|
|
30
|
+
private readonly _analyzer;
|
|
31
|
+
private readonly _node;
|
|
32
|
+
private readonly _firstStageResolutionResult;
|
|
33
|
+
constructor(analyzer: Analyzer, node: tree.BaseExpression, firstStageResolutionResult: FirstStageResolutionsResult);
|
|
34
|
+
resolve(): ResolutionResult;
|
|
35
|
+
private resolveOverriddenMethodAccess;
|
|
36
|
+
private resolveOverriddenOperatorAccess;
|
|
37
|
+
}
|
|
38
|
+
export declare class ResolutionResult {
|
|
29
39
|
readonly meaning: Meaning;
|
|
30
40
|
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
31
41
|
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
32
|
-
static unresolved(diagnostics?: readonly Diagnostic[]):
|
|
42
|
+
static unresolved(diagnostics?: readonly Diagnostic[]): ResolutionResult;
|
|
33
43
|
}
|
|
34
44
|
export type Meaning = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | Meaning_overriddenMethodAccess | Meaning_overriddenOperatorAccess | Meaning_unresolved;
|
|
35
45
|
declare class Meaning_baseObjectAccess {
|
|
@@ -50,6 +60,7 @@ declare class Meaning_baseConstructorAccess {
|
|
|
50
60
|
readonly suitableConstructors: readonly types.Constructor[];
|
|
51
61
|
readonly kind = "base-constructor-access";
|
|
52
62
|
get singleSuitableConstructor(): types.Constructor | undefined;
|
|
63
|
+
get singleConstructor(): types.Constructor | undefined;
|
|
53
64
|
constructor(
|
|
54
65
|
/**
|
|
55
66
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
@@ -61,9 +72,9 @@ declare class Meaning_baseConstructorAccess {
|
|
|
61
72
|
type: types.Type, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[]);
|
|
62
73
|
}
|
|
63
74
|
declare class Meaning_overriddenMethodAccess {
|
|
64
|
-
readonly method:
|
|
75
|
+
readonly method: AccessedFunction;
|
|
65
76
|
readonly kind = "overridden-method-access";
|
|
66
|
-
constructor(method:
|
|
77
|
+
constructor(method: AccessedFunction);
|
|
67
78
|
}
|
|
68
79
|
declare class Meaning_overriddenOperatorAccess {
|
|
69
80
|
readonly operator: types.Operator;
|
|
@@ -73,4 +84,21 @@ declare class Meaning_overriddenOperatorAccess {
|
|
|
73
84
|
declare class Meaning_unresolved {
|
|
74
85
|
readonly kind = "unresolved";
|
|
75
86
|
}
|
|
87
|
+
export declare class FirstStageResolutionsResult {
|
|
88
|
+
readonly meaning: MeaningStage1;
|
|
89
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
90
|
+
constructor(meaning: MeaningStage1, diagnostics?: readonly Diagnostic[] | undefined);
|
|
91
|
+
static unresolved(diagnostics?: readonly Diagnostic[]): FirstStageResolutionsResult;
|
|
92
|
+
}
|
|
93
|
+
export type MeaningStage1 = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | MeaningStage1_overriddenMethodAccess | MeaningStage1_overriddenOperatorAccess | Meaning_unresolved;
|
|
94
|
+
declare class MeaningStage1_overriddenMethodAccess {
|
|
95
|
+
readonly method: types.Method;
|
|
96
|
+
readonly kind = "overridden-method-access";
|
|
97
|
+
constructor(method: types.Method);
|
|
98
|
+
}
|
|
99
|
+
declare class MeaningStage1_overriddenOperatorAccess {
|
|
100
|
+
readonly operator: types.Operator;
|
|
101
|
+
readonly kind = "overridden-operator-access";
|
|
102
|
+
constructor(operator: types.Operator);
|
|
103
|
+
}
|
|
76
104
|
export {};
|