@artel/artc 0.6.25282 → 0.6.25284
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 +28 -20
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1836 -1590
- package/build/{chunk-VVFLEWSA.js → chunk-CGOSDN2E.js} +18023 -15286
- package/build/{chunk-DURHSZYF.js → chunk-OBX375YX.js} +1 -1
- package/build/{chunk-3DN3M64Y.js → chunk-ZV3UW5X6.js} +2 -2
- package/build/types/analysis/AccessibilityCheck.d.ts +20 -0
- package/build/types/analysis/Analyzer.d.ts +53 -78
- package/build/types/analysis/BaseMemberConflictsValidator.d.ts +2 -4
- package/build/types/analysis/ConstructorCallResolver.d.ts +3 -4
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +2 -1
- package/build/types/analysis/ModifierValidator.d.ts +17 -15
- package/build/types/analysis/NodeTypeUtils.d.ts +3 -3
- package/build/types/analysis/PackageMemberLookup.d.ts +11 -4
- package/build/types/analysis/ReachabilityChecker.d.ts +27 -0
- package/build/types/analysis/ReductionSourceMemberFinder.d.ts +20 -0
- package/build/types/analysis/ReservedNameDictionary.d.ts +14 -0
- package/build/types/analysis/ResolvedImplementationPackage.d.ts +48 -0
- package/build/types/analysis/SourceFileAnalyzer.d.ts +3 -0
- package/build/types/analysis/TypeArgumentInferrer.d.ts +1 -0
- package/build/types/analysis/TypeMemberLookup.d.ts +36 -22
- package/build/types/analysis/Utils.d.ts +2 -0
- package/build/types/analysis/WellKnownDeclarations.d.ts +11 -7
- package/build/types/analysis/control-flow/GraphBuilder.d.ts +4 -1
- package/build/types/analysis/semantic-context/FieldWithInitializerSemanticContext.d.ts +6 -5
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +8 -7
- package/build/types/analysis/semantic-context/SemanticContextValidatingNameConflicts.d.ts +4 -5
- package/build/types/analysis/semantic-context/SemanticContextWithParent.d.ts +2 -0
- package/build/types/analysis/semantic-context/SourceFileSemanticContext.d.ts +11 -6
- package/build/types/analysis/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +5 -5
- package/build/types/analysis/semantic-context/SubprogramSemanticContext.d.ts +4 -5
- package/build/types/analysis/semantic-context/TypeSemanticContext.d.ts +18 -15
- package/build/types/api/Api.d.ts +1 -1
- package/build/types/common/HelperPhrases.d.ts +2 -1
- package/build/types/common/LocalizationHelper.d.ts +8 -6
- package/build/types/common/index.d.ts +0 -1
- package/build/types/diagnostic/DiagnosticCode.d.ts +154 -131
- package/build/types/emitter/Entities.d.ts +5 -4
- package/build/types/emitter/EntityMap.d.ts +5 -1
- package/build/types/emitter/IrBuilder.d.ts +1 -0
- package/build/types/emitter/ir/Nodes.d.ts +11 -2
- package/build/types/entities/Entity.d.ts +9 -18
- package/build/types/entities/EntityHiding.d.ts +1 -4
- package/build/types/entities/EntityLocalizationContext.d.ts +3 -3
- package/build/types/entities/IEntity.d.ts +2 -1
- package/build/types/entities/OperatorKind.d.ts +6 -3
- package/build/types/entities/TypeEntity.d.ts +7 -6
- package/build/types/entities/index.d.ts +0 -2
- package/build/types/entities/interfaces/AliasTypeEntity.d.ts +1 -6
- package/build/types/entities/interfaces/ConstructorEntity.d.ts +3 -5
- package/build/types/entities/interfaces/DereferenceOperatorEntity.d.ts +2 -5
- package/build/types/entities/interfaces/DestructorEntity.d.ts +4 -5
- package/build/types/entities/interfaces/FunctionEntity.d.ts +3 -8
- package/build/types/entities/interfaces/FunctionTypeEntity.d.ts +0 -8
- package/build/types/entities/interfaces/GetterEntity.d.ts +0 -4
- package/build/types/entities/interfaces/IndexerEntity.d.ts +2 -5
- package/build/types/entities/interfaces/OperatorEntity.d.ts +3 -5
- package/build/types/entities/interfaces/PackageAliasEntity.d.ts +0 -5
- package/build/types/entities/interfaces/PackageEntity.d.ts +1 -9
- package/build/types/entities/interfaces/ReducedTypeEntity.d.ts +99 -0
- package/build/types/entities/interfaces/SetterEntity.d.ts +0 -4
- package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +0 -8
- package/build/types/entities/interfaces/TextTranslationEntity.d.ts +1 -0
- package/build/types/entities/interfaces/TypeExtensionEntity.d.ts +1 -7
- package/build/types/entities/interfaces/TypeParameterEntity.d.ts +2 -4
- package/build/types/entities/interfaces/VariableEntity.d.ts +2 -11
- package/build/types/entities/interfaces/VariantTypeEntity.d.ts +1 -8
- package/build/types/entities/interfaces/index.d.ts +1 -0
- package/build/types/entities/intrinsic/IntrinsicConstructorEntity.d.ts +3 -1
- package/build/types/entities/intrinsic/IntrinsicFunctionEntity.d.ts +2 -1
- package/build/types/entities/intrinsic/IntrinsicFunctionTypeEntity.d.ts +3 -3
- package/build/types/entities/intrinsic/IntrinsicStructuredTypeEntity.d.ts +3 -3
- package/build/types/entities/intrinsic/IntrinsicTypeParameterEntity.d.ts +2 -4
- package/build/types/entities/intrinsic/IntrinsicVariableEntity.d.ts +2 -1
- package/build/types/entities/source/SourceAliasTypeEntity.d.ts +1 -2
- package/build/types/entities/source/SourceConstructorEntity.d.ts +6 -2
- package/build/types/entities/source/SourceDereferenceOperatorEntity.d.ts +3 -1
- package/build/types/entities/source/SourceDestructorEntity.d.ts +6 -1
- package/build/types/entities/source/SourceFunctionEntity.d.ts +5 -1
- package/build/types/entities/source/SourceFunctionTypeEntity.d.ts +1 -3
- package/build/types/entities/source/SourceIndexerEntity.d.ts +3 -1
- package/build/types/entities/source/SourceOperatorEntity.d.ts +5 -1
- package/build/types/entities/source/SourceReducedTypeEntity.d.ts +44 -0
- package/build/types/entities/source/SourceStructuredTypeEntity.d.ts +1 -3
- package/build/types/entities/source/SourceTextTranslationEntity.d.ts +1 -0
- package/build/types/entities/source/SourceTypeExtensionEntity.d.ts +1 -2
- package/build/types/entities/source/SourceTypeParameterEntity.d.ts +1 -2
- package/build/types/entities/source/SourceVariableEntity.d.ts +7 -1
- package/build/types/entities/source/SourceVariantTypeEntity.d.ts +1 -3
- package/build/types/entities/source/index.d.ts +1 -0
- package/build/types/entities/translated/TranslatedAliasTypeEntity.d.ts +1 -3
- package/build/types/entities/translated/TranslatedConstructorEntity.d.ts +9 -4
- package/build/types/entities/translated/TranslatedDereferenceOperatorEntity.d.ts +3 -1
- package/build/types/entities/translated/TranslatedDestructorEntity.d.ts +4 -1
- package/build/types/entities/translated/TranslatedFunctionEntity.d.ts +3 -1
- package/build/types/entities/translated/TranslatedFunctionTypeEntity.d.ts +1 -5
- package/build/types/entities/translated/TranslatedIndexerEntity.d.ts +3 -1
- package/build/types/entities/translated/TranslatedOperatorEntity.d.ts +3 -1
- package/build/types/entities/translated/TranslatedReducedTypeEntity.d.ts +59 -0
- package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +1 -5
- package/build/types/entities/translated/TranslatedTypeExtensionEntity.d.ts +1 -3
- package/build/types/entities/translated/TranslatedTypeParameterEntity.d.ts +1 -3
- package/build/types/entities/translated/TranslatedVariableEntity.d.ts +3 -1
- package/build/types/entities/translated/TranslatedVariantTypeEntity.d.ts +1 -5
- package/build/types/entities/translated/index.d.ts +1 -0
- package/build/types/parser/KeywordDictionary.d.ts +10 -2
- package/build/types/parser/TokenKind.d.ts +46 -44
- package/build/types/project/SourceFile.d.ts +3 -1
- package/build/types/services/CompletionService.d.ts +5 -4
- package/build/types/services/CustomRequests.d.ts +17 -6
- package/build/types/services/DisplayService.d.ts +78 -3
- package/build/types/services/LanguageServer.d.ts +3 -4
- package/build/types/services/ScriptEditingService.d.ts +25 -0
- package/build/types/services/TranslationService.d.ts +1 -1
- package/build/types/services/Types.d.ts +6 -0
- package/build/types/services/source-generation/EntityToSyntax.d.ts +16 -0
- package/build/types/tree/BaseNode.d.ts +56 -2
- package/build/types/tree/KeywordFlags.d.ts +28 -0
- package/build/types/tree/KeywordKind.d.ts +57 -54
- package/build/types/tree/NodeKind.d.ts +142 -140
- package/build/types/tree/Nodes.d.ts +55 -29
- package/build/types/tree/NodesDebug.d.ts +9 -0
- package/build/types/tree/OperatorKind.d.ts +6 -3
- package/build/types/tree/SyntaxFactory.d.ts +33 -29
- package/build/types/tree/SyntaxToCode.d.ts +4 -0
- package/build/types/tree/TokenFlags.d.ts +15 -0
- package/build/types/tree/TokenKind.d.ts +58 -44
- package/build/types/tree/Utils.d.ts +2 -2
- package/build/types/tree/index.d.ts +2 -1
- package/build/types/ts-interop/Entities.d.ts +11 -12
- package/build/types/ts-interop/TsInteropContext.d.ts +1 -2
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +1 -1
- package/build/types/types/AliasType.d.ts +0 -1
- package/build/types/types/FunctionType.d.ts +0 -1
- package/build/types/types/IntersectionType.d.ts +0 -1
- package/build/types/types/ParameterType.d.ts +0 -1
- package/build/types/types/ReducedType.d.ts +24 -0
- package/build/types/types/StructuredType.d.ts +1 -2
- package/build/types/types/SubstitutionStubType.d.ts +21 -0
- package/build/types/types/Type.d.ts +5 -3
- package/build/types/types/TypeFactory.d.ts +4 -2
- package/build/types/types/UnionType.d.ts +0 -1
- package/build/types/types/UnresolvedType.d.ts +0 -1
- package/build/types/types/VariantType.d.ts +0 -1
- package/build/types/types/index.d.ts +3 -1
- package/package.json +1 -1
- package/build/types/analysis/semantic-context/SemanticContextBasedEntityHidingMatcher.d.ts +0 -14
- package/build/types/entities/BaseEntityHidingMatcher.d.ts +0 -11
- package/build/types/entities/EntityHidingMatcherWithinTypeEntity.d.ts +0 -10
- package/build/types/parser/ReservedIdentifierDictionary.d.ts +0 -11
- package/build/types/services/AddBlockToScriptService.d.ts +0 -17
- package/build/types/services/AssignFieldService.d.ts +0 -10
- package/build/types/services/DeleteBlockFromScriptService.d.ts +0 -6
- package/build/types/tree/Token.d.ts +0 -58
- /package/build/types/services/{ProjectItemsService.d.ts → WorkspaceItemsService.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBX375YX.js";
|
|
4
4
|
import {
|
|
5
5
|
ArtelVersion,
|
|
6
6
|
Cached,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
__async,
|
|
16
16
|
performanceMeasurementStageNames,
|
|
17
17
|
performanceMeasurementStages
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CGOSDN2E.js";
|
|
19
19
|
|
|
20
20
|
// source/executor/FileSystemUri.ts
|
|
21
21
|
import { platform } from "os";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AccessorEntity, PackageMemberEntity, TypeMemberEntity } from '../entities/index.js';
|
|
2
|
+
import * as types from '../types/index.js';
|
|
3
|
+
import { PackageMemberLookupContext } from './PackageMemberLookup.js';
|
|
4
|
+
import { TypeMemberLookupContext } from './TypeMemberLookup.js';
|
|
5
|
+
export declare class AccessibilityCheck {
|
|
6
|
+
static isPackageMemberAccessible(entity: PackageMemberEntity | AccessorEntity, context: PackageMemberLookupContext): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Проверяет, доступен ли член типа в заданном контексте (в точке, где происходит обращение).
|
|
9
|
+
*
|
|
10
|
+
* Помимо контекста, на доступность членов типа, скрытых в иерархии типов, влияет тип объекта (`receiverType`),
|
|
11
|
+
* через который происходит обращение. Тип объекта должен быть равным или производным от типа, в рамках которого
|
|
12
|
+
* происходит доступ (`context.typeOrExtensionEntity`). Для всеобщих членов типа тип объекта не влияет на доступность.
|
|
13
|
+
* Это правило также не применяется при доступе через "основа", поскольку несмотря на то, что тип основы не является
|
|
14
|
+
* производным от типа, в котором происходит обращение, члены основы должны быть доступны в производном типе.
|
|
15
|
+
* Поэтому в случае доступа через "основа" в качестве значения параметра `ignoreReceiverType` передавать `true`.
|
|
16
|
+
*/
|
|
17
|
+
static isTypeMemberAccessible(entity: TypeMemberEntity | AccessorEntity, context: TypeMemberLookupContext | undefined, receiverType: types.Type | undefined, ignoreReceiverType: boolean): boolean;
|
|
18
|
+
private static isTypeDerivedFromOrEquals;
|
|
19
|
+
private static isStaticTypeMemberOrAccessorEntity;
|
|
20
|
+
}
|
|
@@ -6,7 +6,6 @@ import { DiagnosticFlags, DiagnosticKind } from '../diagnostic/DiagnosticData.js
|
|
|
6
6
|
import { WithDiagnostics } from '../diagnostic/WithDiagnostics.js';
|
|
7
7
|
import { BinaryOperatorKind } from '../entities/OperatorKind.js';
|
|
8
8
|
import * as e from '../entities/index.js';
|
|
9
|
-
import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
|
|
10
9
|
import * as project from '../project/index.js';
|
|
11
10
|
import { PackageName, PlatformKind, SourcePackage } from '../project/index.js';
|
|
12
11
|
import * as tree from '../tree/index.js';
|
|
@@ -28,14 +27,19 @@ import * as indexedAccessExpressionMeaning from './IndexedAccessExpressionMeanin
|
|
|
28
27
|
import * as memberAccessExpressionResolution from './MemberAccessExpressionMeaning.js';
|
|
29
28
|
import { ModifierFlags } from './ModifierFlags.js';
|
|
30
29
|
import { NamedTypeSpecifierResolutionResult } from './NamedTypeSpecifierResolver.js';
|
|
31
|
-
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, RegularOrBlockFunctionLiteral, SetterDeclaration, StructuredTypeDeclaration,
|
|
30
|
+
import { DereferencedVariableAccessorDeclaration, FieldAccessorDeclaration, FunctionDeclaration, FunctionTypeDeclaration, GetterDeclaration, IndexedElementAccessorDeclaration, PackageVariableAccessorDeclaration, RegularOrBlockFunctionLiteral, SetterDeclaration, StructuredTypeDeclaration, TypeWithMembersDeclaration, VariantTypeDeclaration } from './NodeTypeUtils.js';
|
|
32
31
|
import * as objectExpressionMeaning from './ObjectExpressionMeaning.js';
|
|
33
32
|
import { OwnAndBaseConstructorCallsCheckResult } from './OwnAndBaseConstructorCallsChecker.js';
|
|
33
|
+
import { ReachabilityChecker } from './ReachabilityChecker.js';
|
|
34
|
+
import { ReductionSourceMemberFinder } from './ReductionSourceMemberFinder.js';
|
|
35
|
+
import { ReservedNameKind } from './ReservedNameDictionary.js';
|
|
36
|
+
import { ResolvedImplementationPackage } from './ResolvedImplementationPackage.js';
|
|
34
37
|
import { ResolvedTextTranslationPackage } from './ResolvedTextTranslationPackage.js';
|
|
35
38
|
import * as tags from './Tag.js';
|
|
36
39
|
import * as tagMeaning from './TagMeaning.js';
|
|
37
40
|
import { TypeWithMembersOrTypeExtensionDeclaration } from './TreeQuery.js';
|
|
38
41
|
import { TypeMemberImplementationCheckResult } from './TypeMemberImplementationChecker.js';
|
|
42
|
+
import { TypeMemberLookupContext } from './TypeMemberLookup.js';
|
|
39
43
|
import * as controlFlow from './control-flow/index.js';
|
|
40
44
|
import { WellKnownDeclarations } from './index.js';
|
|
41
45
|
import * as semanticContext from './semantic-context/index.js';
|
|
@@ -65,13 +69,15 @@ export declare class Analyzer {
|
|
|
65
69
|
readonly argumentToParameterMatchResult: ArgumentToParameterMatchResult;
|
|
66
70
|
readonly overriddenMember: OverriddenMember;
|
|
67
71
|
readonly tags: Tags;
|
|
68
|
-
readonly
|
|
72
|
+
readonly implementation: ImplementationEntity;
|
|
69
73
|
readonly owningPlainObjectModificationCheck: OwningPlainObjectModificationCheck;
|
|
70
74
|
readonly packageImports: PackageImports;
|
|
71
75
|
readonly typeUtils: TypeUtils;
|
|
72
76
|
readonly signatureComparer: SignatureComparer;
|
|
73
77
|
readonly conflictsCheck: ConflictsCheck;
|
|
74
78
|
readonly typeAssignabilityCheck: TypeAssignabilityCheck;
|
|
79
|
+
readonly reachabilityChecker: ReachabilityChecker;
|
|
80
|
+
readonly reductionSourceMemberFinder: ReductionSourceMemberFinder;
|
|
75
81
|
private readonly tsInteropInputs;
|
|
76
82
|
private readonly targetType;
|
|
77
83
|
private readonly tsInterop_;
|
|
@@ -96,7 +102,7 @@ export declare class Analyzer {
|
|
|
96
102
|
private textTranslationPackagesByTargetPackage;
|
|
97
103
|
private primaryTextTranslationPackageByTargetPackage;
|
|
98
104
|
private resolvedLocalizableTexts;
|
|
99
|
-
private readonly
|
|
105
|
+
private readonly resolvedImplementationPackagesByPlatform;
|
|
100
106
|
private readonly isFunctionGeneratorCheckResults;
|
|
101
107
|
private readonly namedDeclarationsUsageCountResults;
|
|
102
108
|
private readonly packageAndStaticVariablesInitializationDiagnostics;
|
|
@@ -178,10 +184,11 @@ export declare class Analyzer {
|
|
|
178
184
|
isExpressionOptionalChainingSyntactically(node: tree.Expression): boolean;
|
|
179
185
|
isExpressionValidOutermostOptionalChaining(node: tree.Expression): boolean;
|
|
180
186
|
includeNullToTypeIfExpressionValidOutermostOptionalChaining(type: types.Type, node: tree.Expression): types.Type;
|
|
181
|
-
checkIdentifierNameIsReserved(name:
|
|
182
|
-
|
|
187
|
+
checkIdentifierNameIsReserved(name: Name, locale: PackageLocale): ReservedNameKind | undefined;
|
|
188
|
+
getReservedName(reservedNameKind: ReservedNameKind, locale: PackageLocale): Name;
|
|
183
189
|
createNameFromIdentifier(node: tree.Identifier): Name;
|
|
184
190
|
getImplicitBaseTypeForStructuredType(entity: e.StructuredTypeEntity): types.StructuredType | undefined;
|
|
191
|
+
getImplicitBaseTypeForReducedType(entity: e.ReducedTypeEntity): types.StructuredType;
|
|
185
192
|
getImplicitBaseTypeForVariantType(locale: PackageLocale): types.StructuredType;
|
|
186
193
|
getImplicitBaseTypeForFunctionType(locale: PackageLocale): types.StructuredType;
|
|
187
194
|
resolveNamedTypeSpecifier(node: tree.NamedTypeSpecifier): NamedTypeSpecifierResolutionResult;
|
|
@@ -262,8 +269,9 @@ export declare class Analyzer {
|
|
|
262
269
|
getLocalizedPackageWithLocale(originalPackageEntity: e.PackageEntity, locale: PackageLocale): e.PackageEntity | undefined;
|
|
263
270
|
enumerateAnalyzedTranslationPackages(): Query<AnalyzedTranslationPackage>;
|
|
264
271
|
enumerateResolvedTextTranslationPackages(): Query<ResolvedTextTranslationPackage>;
|
|
265
|
-
|
|
266
|
-
|
|
272
|
+
getResolvedImplementationPackagesByPlatform(interfacePackage: e.PackageEntity): ReadonlyMap<PlatformKind, ResolvedImplementationPackage> | undefined;
|
|
273
|
+
getResolvedImplementationPackageForInterfacePackage(interfacePackage: e.PackageEntity, platform: PlatformKind): ResolvedImplementationPackage | undefined;
|
|
274
|
+
getResolvedImplementationPackage(implementationPackage: e.PackageEntity): ResolvedImplementationPackage | undefined;
|
|
267
275
|
getTextTranslationPackagesMap(): ReadonlyMap<e.PackageEntity, ResolvedTextTranslationPackage[]>;
|
|
268
276
|
getTextTranslationPackagesOfTargetPackage(targetPackage: e.PackageEntity): ResolvedTextTranslationPackage[] | undefined;
|
|
269
277
|
getPrimaryTextTranslationPackageOfTargetPackage(targetPackage: e.PackageEntity): ResolvedTextTranslationPackage | undefined;
|
|
@@ -276,6 +284,8 @@ export declare class Analyzer {
|
|
|
276
284
|
instantiateTypeMemberByIdentitySubstitution(entity: e.OperatorEntity): types.Operator;
|
|
277
285
|
instantiateTypeMemberByIdentitySubstitution(entity: e.IndexerEntity): types.Indexer;
|
|
278
286
|
instantiateTypeMemberByIdentitySubstitution(entity: e.DereferenceOperatorEntity): types.DereferenceOperator;
|
|
287
|
+
instantiateTypeMemberByIdentitySubstitution(entity: e.ConstructorEntity): types.Constructor;
|
|
288
|
+
instantiateTypeMemberByIdentitySubstitution(entity: e.DestructorEntity): types.Destructor;
|
|
279
289
|
instantiateTypeMemberByIdentitySubstitution(entity: e.TypeMemberEntity): types.TypeMember;
|
|
280
290
|
createPackageMemberHiding(node: tree.PackageMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
|
|
281
291
|
createTypeMemberHiding(node: tree.TypeMemberDeclaration, modifierFlags: ModifierFlags): e.EntityHidingLevel | undefined;
|
|
@@ -305,7 +315,6 @@ export declare class Analyzer {
|
|
|
305
315
|
validateSourcePackageMemberConflicts(pkg: project.ProgramOrTextTranslationPackage): readonly Diagnostic[];
|
|
306
316
|
getNotExplicitlyImplementedAbstractMembers(typeEntity: e.TypeEntityWithMembers): readonly types.TypeMember[];
|
|
307
317
|
getTypeMemberImplementationCheckResult(typeEntity: e.TypeEntityWithMembers): TypeMemberImplementationCheckResult;
|
|
308
|
-
createEntityContextForTypeDeclaration(node: TypeDeclaration): e.EntityContext;
|
|
309
318
|
isFunctionBlockWithImplicitlyReturnedExpression(node: tree.FunctionBlock): boolean;
|
|
310
319
|
getLocalizedWellKnownDeclarations(locale: PackageLocale): WellKnownDeclarations;
|
|
311
320
|
getLocalizedStandardTypes(locale: PackageLocale): types.StandardTypes;
|
|
@@ -319,6 +328,8 @@ export declare class Analyzer {
|
|
|
319
328
|
checkTypeArgumentCount(typeArgumentCount: number, typeParameters: readonly e.TypeParameterEntity[], diagnostics?: DiagnosticAcceptor, nodeForDiagnostic?: tree.Node): boolean;
|
|
320
329
|
checkTypeCanBeUsedAsValue(typeAccess: tree.Expression): boolean;
|
|
321
330
|
getEntityDiagnosticLocation(entity: e.Entity, chooseSetter?: boolean): DiagnosticLocation | undefined;
|
|
331
|
+
createTypeMemberLookupContextWithinType(type: e.TypeEntity): TypeMemberLookupContext;
|
|
332
|
+
isPossiblyCastedBaseExpression(node: tree.Expression): boolean;
|
|
322
333
|
private createTsInterop;
|
|
323
334
|
}
|
|
324
335
|
export declare class TsInteropInputs {
|
|
@@ -352,6 +363,9 @@ export declare namespace BinaryExpressionOperatorClassificationResult {
|
|
|
352
363
|
const bitwiseAnd: BinaryExpressionOperatorClassificationResult;
|
|
353
364
|
const bitwiseOr: BinaryExpressionOperatorClassificationResult;
|
|
354
365
|
const bitwiseXor: BinaryExpressionOperatorClassificationResult;
|
|
366
|
+
const leftShift: BinaryExpressionOperatorClassificationResult;
|
|
367
|
+
const signedRightShift: BinaryExpressionOperatorClassificationResult;
|
|
368
|
+
const unsignedRightShift: BinaryExpressionOperatorClassificationResult;
|
|
355
369
|
const and: BinaryExpressionOperatorClassificationResult;
|
|
356
370
|
const or: BinaryExpressionOperatorClassificationResult;
|
|
357
371
|
const xor: BinaryExpressionOperatorClassificationResult;
|
|
@@ -376,10 +390,11 @@ declare class Type {
|
|
|
376
390
|
private readonly intersectionTypeSpecifierTypes;
|
|
377
391
|
private readonly functionLiteralTypes;
|
|
378
392
|
private readonly nodesForWhichReturnTypeInferenceDiagnosticHasBeenReported;
|
|
393
|
+
private recursionDepth;
|
|
379
394
|
constructor(analyzer: Analyzer);
|
|
380
395
|
ofExpression(node: tree.Expression, analysisOptions?: ExpressionAnalysisOptions): types.Type;
|
|
381
396
|
ofTypeSpecifier(node: tree.TypeSpecifier): types.Type;
|
|
382
|
-
|
|
397
|
+
private ofExpressionWithoutGuard;
|
|
383
398
|
private ofFunctionBlockLiteral;
|
|
384
399
|
private ofFunctionLiteral;
|
|
385
400
|
private ofRegularOrBlockFunctionLiteral;
|
|
@@ -462,6 +477,7 @@ declare class Entity {
|
|
|
462
477
|
private readonly packageFunctionTypeEntities;
|
|
463
478
|
private readonly anonymousFunctionTypeEntities;
|
|
464
479
|
private readonly aliasTypeEntities;
|
|
480
|
+
private readonly reducedTypeEntities;
|
|
465
481
|
private readonly packageFunctionEntities;
|
|
466
482
|
private readonly methodEntities;
|
|
467
483
|
private readonly nestedFunctionEntities;
|
|
@@ -498,6 +514,7 @@ declare class Entity {
|
|
|
498
514
|
ofAnonymousVariantTypeDeclaration(node: tree.AnonymousVariantTypeDeclaration): e.AnonymousVariantTypeEntity;
|
|
499
515
|
ofVariantTypeDeclaration(node: VariantTypeDeclaration): e.VariantTypeEntity;
|
|
500
516
|
ofPackageAliasTypeDeclaration(node: tree.PackageAliasTypeDeclaration): e.AliasTypeEntity;
|
|
517
|
+
ofPackageReducedTypeDeclaration(node: tree.PackageReducedTypeDeclaration): e.ReducedTypeEntity;
|
|
501
518
|
ofPackageFunctionDeclaration(node: tree.PackageFunctionDeclaration): e.PackageFunctionEntity;
|
|
502
519
|
ofMethodDeclaration(node: tree.MethodDeclaration): e.MethodEntity;
|
|
503
520
|
ofNestedFunctionDeclaration(node: tree.NestedFunctionDeclaration): e.NestedFunctionEntity;
|
|
@@ -562,8 +579,30 @@ declare class ValueLocalVariableEntity {
|
|
|
562
579
|
ofDereferencedVariableSetterDeclaration(node: tree.DereferencedVariableSetterDeclaration): e.LocalVariableEntity;
|
|
563
580
|
private createValueLocalVariableEntity;
|
|
564
581
|
}
|
|
582
|
+
export declare enum SignatureComparisonOptions {
|
|
583
|
+
None = 0,
|
|
584
|
+
CompareNames = 1,
|
|
585
|
+
CompareReturnTypes = 2,
|
|
586
|
+
CheckTypeParameterCountIntersection = 4
|
|
587
|
+
}
|
|
588
|
+
type TypeComparer = (t1: types.Type, t2: types.Type) => boolean;
|
|
589
|
+
declare class SignatureComparer {
|
|
590
|
+
private readonly analyzer;
|
|
591
|
+
private readonly substitutionStubTypes;
|
|
592
|
+
constructor(analyzer: Analyzer);
|
|
593
|
+
areEqualFunctionEntities(function1: e.FunctionEntity, function2: e.FunctionEntity, options: SignatureComparisonOptions, typeComparer?: TypeComparer): boolean;
|
|
594
|
+
areEqualMethods(method1: types.Method, method2: types.Method, options: SignatureComparisonOptions, typeComparer?: TypeComparer): boolean;
|
|
595
|
+
areEqualSignaturesWithoutTypeParameters(entity1: EntityWithoutTypeParametersInSignature, entity2: EntityWithoutTypeParametersInSignature, options: SignatureComparisonOptions, typeComparer?: TypeComparer): boolean;
|
|
596
|
+
areEqualTypeMemberSignaturesWithoutTypeParameters(member1: TypeMemberWithoutTypeParametersInSignature, member2: TypeMemberWithoutTypeParametersInSignature, options: SignatureComparisonOptions, typeComparer?: TypeComparer): boolean;
|
|
597
|
+
doTypeParameterCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
598
|
+
private areEqualParameters;
|
|
599
|
+
private areEqualTypeMemberParameters;
|
|
600
|
+
private areEqualTypes;
|
|
601
|
+
private createSubstitutionsWithStubTypes;
|
|
602
|
+
}
|
|
565
603
|
declare class OverriddenMember {
|
|
566
604
|
private readonly analyzer;
|
|
605
|
+
static readonly signatureComparisonOptions = SignatureComparisonOptions.None;
|
|
567
606
|
private readonly namedMemberFinder;
|
|
568
607
|
private readonly operatorFinder;
|
|
569
608
|
private readonly indexerFinder;
|
|
@@ -586,7 +625,6 @@ declare class OverriddenMember {
|
|
|
586
625
|
getOverriddenAndShadowedDereferenceOperators(node: DereferencedVariableAccessorDeclaration): OverriddenAndShadowedMembers<types.DereferenceOperator>;
|
|
587
626
|
entityCanBeOverridden(entity: OverridableTypeMemberEntity): boolean;
|
|
588
627
|
getMemberTypeOrReturnType(member: types.TypeMember): types.Type;
|
|
589
|
-
findMatchingMembersInType(member: types.TypeMember, type: types.Type): readonly types.TypeMember[];
|
|
590
628
|
private findOverriddenMembers;
|
|
591
629
|
private findOverriddenOrShadowedNamedMembersInType;
|
|
592
630
|
private findOverriddenOrShadowedOperatorsInType;
|
|
@@ -630,10 +668,10 @@ declare class Tags {
|
|
|
630
668
|
private createTagFromNode;
|
|
631
669
|
private argumentToTagArgument;
|
|
632
670
|
}
|
|
633
|
-
declare class
|
|
671
|
+
declare class ImplementationEntity {
|
|
634
672
|
private readonly analyzer;
|
|
635
673
|
constructor(analyzer: Analyzer);
|
|
636
|
-
|
|
674
|
+
entityCanHaveImplementation(entity: e.Entity): boolean;
|
|
637
675
|
ofType(entity: e.TypeEntity, platform: PlatformKind): e.TypeEntity | undefined;
|
|
638
676
|
ofTypeWithMembers(entity: e.TypeEntityWithMembers, platform: PlatformKind): e.TypeEntityWithMembers | undefined;
|
|
639
677
|
ofParameterType(entity: e.TypeParameterEntity, platform: PlatformKind): e.TypeParameterEntity | undefined;
|
|
@@ -643,49 +681,12 @@ declare class LinkedEntity {
|
|
|
643
681
|
ofMethod(entity: e.MethodEntity, platform: PlatformKind): e.MethodEntity | undefined;
|
|
644
682
|
ofOperator(entity: e.OperatorEntity, platform: PlatformKind): e.OperatorEntity | undefined;
|
|
645
683
|
ofConstructor(entity: e.ConstructorEntity, platform: PlatformKind): e.ConstructorEntity | undefined;
|
|
684
|
+
ofDestructor(entity: e.DestructorEntity, platform: PlatformKind): e.DestructorEntity | undefined;
|
|
646
685
|
ofIndexer(entity: e.IndexerEntity, platform: PlatformKind): e.IndexerEntity | undefined;
|
|
647
686
|
ofDereferenceOperator(entity: e.DereferenceOperatorEntity, platform: PlatformKind): e.DereferenceOperatorEntity | undefined;
|
|
648
687
|
ofGetter(entity: e.GetterEntity, platform: PlatformKind): e.GetterEntity | undefined;
|
|
649
688
|
ofSetter(entity: e.SetterEntity, platform: PlatformKind): e.SetterEntity | undefined;
|
|
650
689
|
}
|
|
651
|
-
export declare class LinkedMultiPlatformPackage {
|
|
652
|
-
readonly analyzer: Analyzer;
|
|
653
|
-
readonly pkg: e.PackageEntity;
|
|
654
|
-
readonly implementationPackage: e.PackageEntity;
|
|
655
|
-
readonly targetPlatform: PlatformKind;
|
|
656
|
-
private readonly memberLookup_;
|
|
657
|
-
private readonly linkedTypesWithMembers;
|
|
658
|
-
private readonly linkedParameterTypes;
|
|
659
|
-
private get memberLookup();
|
|
660
|
-
constructor(analyzer: Analyzer, pkg: e.PackageEntity, implementationPackage: e.PackageEntity, targetPlatform: PlatformKind);
|
|
661
|
-
getLinkedVariable(entity: e.PackageVariableEntity): e.PackageVariableEntity | undefined;
|
|
662
|
-
getLinkedMethod(entity: e.PackageFunctionEntity): e.PackageFunctionEntity | undefined;
|
|
663
|
-
getLinkedTypeWithMembers(entity: e.TypeEntityWithMembers): LinkedTypeWithMembers | undefined;
|
|
664
|
-
getLinkedParameterType(entity: e.TypeParameterEntity): e.TypeParameterEntity | undefined;
|
|
665
|
-
/**
|
|
666
|
-
* Используется для сравнения типов при связывании объявления из многоплатформенного пакета с объявлением из
|
|
667
|
-
* реализационного пакета. В частности, при сравнении типов параметров для выбора правильной перегрузки
|
|
668
|
-
* метода (конструктора, индексатора).
|
|
669
|
-
*/
|
|
670
|
-
compareTypesDuringLinking(type1: types.Type, type2: types.Type): boolean;
|
|
671
|
-
private findPackageType;
|
|
672
|
-
private compareSubstitutionsDuringLinking;
|
|
673
|
-
}
|
|
674
|
-
export declare class LinkedTypeWithMembers {
|
|
675
|
-
readonly analyzer: Analyzer;
|
|
676
|
-
readonly externalType: e.TypeEntityWithMembers;
|
|
677
|
-
readonly targetType: e.TypeEntityWithMembers;
|
|
678
|
-
readonly linkedPackage: LinkedMultiPlatformPackage;
|
|
679
|
-
private readonly memberLookup_;
|
|
680
|
-
private get memberLookup();
|
|
681
|
-
constructor(analyzer: Analyzer, externalType: e.TypeEntityWithMembers, targetType: e.TypeEntityWithMembers, linkedPackage: LinkedMultiPlatformPackage);
|
|
682
|
-
getLinkedField(entity: e.FieldEntity): e.FieldEntity | undefined;
|
|
683
|
-
getLinkedMethod(entity: e.MethodEntity): e.MethodEntity | undefined;
|
|
684
|
-
getLinkedOperator(entity: e.OperatorEntity): e.OperatorEntity | undefined;
|
|
685
|
-
getLinkedConstructor(entity: e.ConstructorEntity): e.ConstructorEntity | undefined;
|
|
686
|
-
getLinkedIndexer(entity: e.IndexerEntity): e.IndexerEntity | undefined;
|
|
687
|
-
getLinkedDereferenceOperator(entity: e.DereferenceOperatorEntity): e.DereferenceOperatorEntity | undefined;
|
|
688
|
-
}
|
|
689
690
|
declare class OwningPlainObjectModificationCheck {
|
|
690
691
|
private analyzer;
|
|
691
692
|
private readonly owningPlainObjectModificationCheckResult;
|
|
@@ -707,6 +708,7 @@ declare class TypeAssignabilityCheck {
|
|
|
707
708
|
getSingleFlagScore(flag: TypeAssignabilityFlags): number;
|
|
708
709
|
getLowestFlagsScore(flags: TypeAssignabilityFlags): number;
|
|
709
710
|
private getAssignabilityFlagsForStructuredTypes;
|
|
711
|
+
private isStructuredTypeDerivedFromOrEqualsTo;
|
|
710
712
|
/**
|
|
711
713
|
* @example
|
|
712
714
|
* ```artel
|
|
@@ -777,33 +779,6 @@ declare class TypeUtils {
|
|
|
777
779
|
private getFlattenedConstituentTypesForCommonTypesSearch;
|
|
778
780
|
private flattenTypeParameterConstraint;
|
|
779
781
|
}
|
|
780
|
-
declare class SignatureComparer {
|
|
781
|
-
private readonly analyzer;
|
|
782
|
-
private readonly stubParameterTypes;
|
|
783
|
-
constructor(analyzer: Analyzer);
|
|
784
|
-
areEqualFunctionEntities(function1: e.FunctionEntity, function2: e.FunctionEntity, options: SignatureComparisonOptions): boolean;
|
|
785
|
-
/**
|
|
786
|
-
* Метод аналогичен методу {@link areEqualFunctionEntities}.
|
|
787
|
-
*/
|
|
788
|
-
areEqualMethods(method1: types.Method, method2: types.Method, options: SignatureComparisonOptions): boolean;
|
|
789
|
-
/**
|
|
790
|
-
* Проверяет, конфликтуют две сущности, имеющие параметры, но не имеющие параметры типа.
|
|
791
|
-
*
|
|
792
|
-
* Отношение "сущности, имеющие только параметры, конфликтуют" является транзитивным.
|
|
793
|
-
*/
|
|
794
|
-
areEqualSignaturesWithoutTypeParameters(entity1: EntityWithoutTypeParametersInSignature, entity2: EntityWithoutTypeParametersInSignature): boolean;
|
|
795
|
-
areEqualTypeMemberSignaturesWithoutTypeParameters(member1: TypeMemberWithoutTypeParametersInSignature, member2: TypeMemberWithoutTypeParametersInSignature): boolean;
|
|
796
|
-
doTypeParameterCountsIntersect(typeParameters1: readonly e.TypeParameterEntity[], typeParameters2: readonly e.TypeParameterEntity[]): boolean;
|
|
797
|
-
private areEqualParameters;
|
|
798
|
-
private areEqualTypeMemberParameters;
|
|
799
|
-
private createSubstitutionsWithStubTypes;
|
|
800
|
-
}
|
|
801
|
-
export declare enum SignatureComparisonOptions {
|
|
802
|
-
None = 0,
|
|
803
|
-
CompareNames = 1,
|
|
804
|
-
CompareReturnTypes = 2,
|
|
805
|
-
CheckTypeParameterCountIntersection = 4
|
|
806
|
-
}
|
|
807
782
|
declare class ConflictsCheck {
|
|
808
783
|
private readonly analyzer;
|
|
809
784
|
private static readonly signatureComparisonOptions;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { DiagnosticAcceptor } from '../diagnostic/Diagnostic.js';
|
|
2
|
-
import {
|
|
2
|
+
import { TypeEntityWithMembers } from '../entities/index.js';
|
|
3
3
|
import { Node } from '../tree/index.js';
|
|
4
4
|
import { Analyzer } from './Analyzer.js';
|
|
5
5
|
import { DiagnosticArgumentFactory } from './DiagnosticArgumentFactory.js';
|
|
6
6
|
export declare class BaseMemberConflictsValidator {
|
|
7
7
|
private readonly analyzer;
|
|
8
8
|
private readonly typeEntity;
|
|
9
|
-
private readonly hidingMatcher;
|
|
10
9
|
private readonly diagnosticArgumentFactory;
|
|
11
10
|
private readonly diagnostics;
|
|
12
11
|
private readonly nodeForDiagnostic;
|
|
13
|
-
constructor(analyzer: Analyzer, typeEntity: TypeEntityWithMembers,
|
|
12
|
+
constructor(analyzer: Analyzer, typeEntity: TypeEntityWithMembers, diagnosticArgumentFactory: DiagnosticArgumentFactory, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: Node);
|
|
14
13
|
validate(): void;
|
|
15
14
|
private getAllNotShadowedNotOverriddenMembers;
|
|
16
15
|
private validateMemberConflicts;
|
|
@@ -20,7 +19,6 @@ export declare class BaseMemberConflictsValidator {
|
|
|
20
19
|
private reportMembersConflictDiagnostic;
|
|
21
20
|
private reportMembersOriginalNameConflictConflictDiagnostic;
|
|
22
21
|
private addOverriddenMembersRecursively;
|
|
23
|
-
private typeMemberMatchesHiding;
|
|
24
22
|
private getOriginalTypeMemberNameConsideringOverriddenMembers;
|
|
25
23
|
private getLeastOverriddenNamedMember;
|
|
26
24
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { PackageLocale } from '../common/index.js';
|
|
2
1
|
import { DiagnosticAcceptorWithArgumentFactory } from '../diagnostic/Diagnostic.js';
|
|
3
|
-
import {
|
|
2
|
+
import { NamedTypeEntity } from '../entities/index.js';
|
|
4
3
|
import * as tree from '../tree/index.js';
|
|
5
4
|
import * as types from '../types/index.js';
|
|
6
5
|
import { Analyzer, ExpressionAnalysisOptions } from './Analyzer.js';
|
|
7
|
-
import {
|
|
6
|
+
import { TypeMemberLookupContext } from './TypeMemberLookup.js';
|
|
8
7
|
export declare class Resolver {
|
|
9
8
|
static resolve(analyzer: Analyzer, candidates: readonly types.Constructor[], argumentList: tree.ArgumentList | undefined, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): readonly types.Constructor[];
|
|
10
|
-
static resolveByNamedTypes(analyzer: Analyzer, typeEntities: readonly NamedTypeEntity[], argumentList: tree.ArgumentList | undefined, typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions,
|
|
9
|
+
static resolveByNamedTypes(analyzer: Analyzer, typeEntities: readonly NamedTypeEntity[], argumentList: tree.ArgumentList | undefined, typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, typeMemberLookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): ResolutionResult;
|
|
11
10
|
private static typeCanBeConstructed;
|
|
12
11
|
}
|
|
13
12
|
export declare class ResolutionResult {
|
|
@@ -24,7 +24,8 @@ export declare class FirstStageResolver {
|
|
|
24
24
|
private resolveStaticMemberOrVariantAccessMeaning;
|
|
25
25
|
private resolveInstanceMemberAccessMeaning;
|
|
26
26
|
private tryResolveInstanceOperatorAccessMeaning;
|
|
27
|
-
private
|
|
27
|
+
private convertPackageVariableSyntacticAccessKind;
|
|
28
|
+
private convertFieldSyntacticAccessKind;
|
|
28
29
|
}
|
|
29
30
|
export declare class SecondStageResolver {
|
|
30
31
|
private readonly analyzer;
|
|
@@ -5,20 +5,21 @@ import { ModifierFlags } from './ModifierFlags.js';
|
|
|
5
5
|
declare enum PackageMemberDeclarationKind {
|
|
6
6
|
TranslationsDeclaration = 0,
|
|
7
7
|
AliasTypeDeclaration = 1,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
ReducedTypeDeclaration = 2,
|
|
9
|
+
MemberGroupDeclaration = 3,
|
|
10
|
+
TypeExtensionDeclaration = 4,
|
|
11
|
+
ConstructorDeclaration = 5,
|
|
12
|
+
EntryPointDeclaration = 6,
|
|
13
|
+
FunctionDeclaration = 7,
|
|
14
|
+
FunctionTypeDeclaration = 8,
|
|
15
|
+
ObjectTypeDeclaration = 9,
|
|
16
|
+
PlainObjectTypeDeclaration = 10,
|
|
17
|
+
AspectTypeDeclaration = 11,
|
|
18
|
+
VariableDeclaration = 12,
|
|
19
|
+
VariableGetterDeclaration = 13,
|
|
20
|
+
VariableSetterDeclaration = 14,
|
|
21
|
+
VariantTypeDeclaration = 15,
|
|
22
|
+
InvalidDeclaration = 16
|
|
22
23
|
}
|
|
23
24
|
type TypeMemberDeclarationKind = tree.TypeMemberDeclaration['kind'];
|
|
24
25
|
export declare enum DeclarationWithTypeMembersKind {
|
|
@@ -27,7 +28,8 @@ export declare enum DeclarationWithTypeMembersKind {
|
|
|
27
28
|
AspectType = 2,
|
|
28
29
|
VariantType = 3,
|
|
29
30
|
AliasType = 4,
|
|
30
|
-
|
|
31
|
+
ReducedType = 5,
|
|
32
|
+
TypeExtension = 6
|
|
31
33
|
}
|
|
32
34
|
export declare class ModifierValidator {
|
|
33
35
|
private readonly analyzer;
|
|
@@ -16,14 +16,14 @@ export declare class NodeTypeUtils {
|
|
|
16
16
|
static isSubprogramDeclarationOrLiteral(node: tree.Node): node is SubprogramDeclarationOrLiteral;
|
|
17
17
|
static isRegularOrBlockFunctionLiteral(node: tree.Node): node is RegularOrBlockFunctionLiteral;
|
|
18
18
|
}
|
|
19
|
-
export type PackageTypeDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration;
|
|
19
|
+
export type PackageTypeDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageReducedTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration;
|
|
20
20
|
export type StructuredTypeDeclaration = tree.PackageStructuredTypeDeclaration | tree.AnonymousStructuredTypeDeclaration;
|
|
21
21
|
export type VariantTypeDeclaration = tree.PackageVariantTypeDeclaration | tree.AnonymousVariantTypeDeclaration;
|
|
22
22
|
export type FunctionTypeDeclaration = tree.PackageFunctionTypeDeclaration | tree.AnonymousFunctionTypeDeclaration;
|
|
23
23
|
export type FunctionDeclaration = tree.PackageFunctionDeclaration | tree.NestedFunctionDeclaration | tree.MethodDeclaration;
|
|
24
24
|
export type TypeDeclaration = StructuredTypeDeclaration | VariantTypeDeclaration | FunctionTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.TypeParameterDeclaration;
|
|
25
|
-
export type NamedTypeDeclaration = tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.TypeParameterDeclaration;
|
|
26
|
-
export type TypeWithMembersDeclaration = StructuredTypeDeclaration | VariantTypeDeclaration | tree.PackageAliasTypeDeclaration;
|
|
25
|
+
export type NamedTypeDeclaration = tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration | tree.PackageFunctionTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.PackageReducedTypeDeclaration | tree.TypeParameterDeclaration;
|
|
26
|
+
export type TypeWithMembersDeclaration = StructuredTypeDeclaration | VariantTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.PackageReducedTypeDeclaration;
|
|
27
27
|
export type VariableDeclaration = tree.ForStatementVariableDeclaration | tree.PackageVariableDeclaration | tree.LocalVariableDeclaration | tree.ParameterDeclaration | tree.FieldDeclaration | tree.VariantValueDeclaration;
|
|
28
28
|
export type GetterDeclaration = tree.PackageVariableGetterDeclaration | tree.FieldGetterDeclaration | tree.IndexedElementGetterDeclaration | tree.DereferencedVariableGetterDeclaration;
|
|
29
29
|
export type SetterDeclaration = tree.PackageVariableSetterDeclaration | tree.FieldSetterDeclaration | tree.IndexedElementSetterDeclaration | tree.DereferencedVariableSetterDeclaration;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Name } from '../common/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { NamedPackageMemberEntity, PackageEntity, TypeEntity, TypeExtensionEntity } from '../entities/index.js';
|
|
3
|
+
import { SourceFile } from '../project/index.js';
|
|
3
4
|
export declare class PackageMemberLookup {
|
|
4
5
|
private readonly package_;
|
|
5
6
|
constructor(package_: PackageEntity);
|
|
6
|
-
getNamedMembers(
|
|
7
|
-
getNamedMembersByName(name: Name,
|
|
8
|
-
getTypeExtensions(type: TypeEntity,
|
|
7
|
+
getNamedMembers(context: PackageMemberLookupContext | undefined): readonly NamedPackageMemberEntity[];
|
|
8
|
+
getNamedMembersByName(name: Name, context: PackageMemberLookupContext | undefined): readonly NamedPackageMemberEntity[];
|
|
9
|
+
getTypeExtensions(type: TypeEntity, context: PackageMemberLookupContext | undefined): readonly TypeExtensionEntity[];
|
|
10
|
+
}
|
|
11
|
+
export declare class PackageMemberLookupContext {
|
|
12
|
+
readonly sourceFile: SourceFile | undefined;
|
|
13
|
+
readonly packageEntity: PackageEntity | undefined;
|
|
14
|
+
constructor(sourceFile: SourceFile | undefined, packageEntity: PackageEntity | undefined);
|
|
15
|
+
affectsAccessibility(): boolean;
|
|
9
16
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Analyzer } from './Analyzer.js';
|
|
2
|
+
import * as controlFlow from './control-flow/index.js';
|
|
3
|
+
export declare class ReachabilityChecker {
|
|
4
|
+
private readonly analyzer;
|
|
5
|
+
private readonly checkResults;
|
|
6
|
+
constructor(analyzer: Analyzer);
|
|
7
|
+
/**
|
|
8
|
+
* Проверяет, достижим ли узел графа потока управления с учётом семантики.
|
|
9
|
+
*
|
|
10
|
+
* Дополнительные проверки необходимы по причине того, что граф потока управления строится на основе синтаксического
|
|
11
|
+
* дерева и не учитывает семантику.
|
|
12
|
+
*
|
|
13
|
+
* Например, следующий код
|
|
14
|
+
* ```artel
|
|
15
|
+
* конст а = Объект()
|
|
16
|
+
* если не(а это Объект)
|
|
17
|
+
* {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* достижим с точки зрения синтаксиса, но недостижим с точки зрения семантики, поскольку типом переменной `а`
|
|
23
|
+
* всегда является `Объект`.
|
|
24
|
+
*/
|
|
25
|
+
isControlFlowNodeReachable(node: controlFlow.Node): boolean;
|
|
26
|
+
private isConditionReachable;
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DiagnosticAcceptor } from '../diagnostic/Diagnostic.js';
|
|
2
|
+
import * as tree from '../tree/index.js';
|
|
3
|
+
import * as types from '../types/index.js';
|
|
4
|
+
import { Analyzer } from './Analyzer.js';
|
|
5
|
+
import { TypeMemberLookupContext } from './TypeMemberLookup.js';
|
|
6
|
+
export declare class ReductionSourceMemberFinder {
|
|
7
|
+
private static signatureComparisonOptions_;
|
|
8
|
+
private static get signatureComparisonOptions();
|
|
9
|
+
private readonly analyzer;
|
|
10
|
+
constructor(analyzer: Analyzer);
|
|
11
|
+
findField(member: types.Field, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Field | undefined;
|
|
12
|
+
findMethod(member: types.Method, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Method | undefined;
|
|
13
|
+
findOperator(member: types.Operator, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Operator | undefined;
|
|
14
|
+
findConstructor(member: types.Constructor, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Constructor | undefined;
|
|
15
|
+
findDestructor(member: types.Destructor, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Destructor | undefined;
|
|
16
|
+
findIndexer(member: types.Indexer, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.Indexer | undefined;
|
|
17
|
+
findDereferenceOperator(member: types.DereferenceOperator, reductionSource: types.Type, lookupContext: TypeMemberLookupContext, diagnostics: DiagnosticAcceptor, nodeForDiagnostic: tree.Node): types.DereferenceOperator | undefined;
|
|
18
|
+
private getTypeMemberLookupOptions;
|
|
19
|
+
private checkMembersHaveSameHiding;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Lazy, Name, PackageLocale } from '../common/index.js';
|
|
2
|
+
export declare const enum ReservedNameKind {
|
|
3
|
+
Result = 0,
|
|
4
|
+
Value = 1
|
|
5
|
+
}
|
|
6
|
+
export declare const reservedNamesByLocale: Lazy<{
|
|
7
|
+
[T in PackageLocale]: {
|
|
8
|
+
[T in ReservedNameKind]: Name;
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
export declare const reservedNameKindByNameKey: Lazy<{
|
|
12
|
+
0: ReadonlyMap<string, ReservedNameKind>;
|
|
13
|
+
1: ReadonlyMap<string, ReservedNameKind>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, FieldEntity, IndexerEntity, MethodEntity, OperatorEntity, PackageEntity, PackageFunctionEntity, PackageTypeEntity, PackageVariableEntity, TypeEntity } from '../entities/index.js';
|
|
2
|
+
import { PlatformKind } from '../project/index.js';
|
|
3
|
+
import { Analyzer } from './Analyzer.js';
|
|
4
|
+
export declare class ResolvedImplementationPackage {
|
|
5
|
+
private readonly analyzer;
|
|
6
|
+
readonly interfacePackage: PackageEntity;
|
|
7
|
+
readonly implementationPackage: PackageEntity;
|
|
8
|
+
readonly targetPlatform: PlatformKind;
|
|
9
|
+
private static signatureComparisonOptions_;
|
|
10
|
+
private static get signatureComparisonOptions();
|
|
11
|
+
private implementationPackageMembers_;
|
|
12
|
+
private readonly diagnostics;
|
|
13
|
+
private readonly variableImplementations;
|
|
14
|
+
private readonly functionImplementations;
|
|
15
|
+
private readonly typeImplementations;
|
|
16
|
+
private readonly typeMemberImplementations;
|
|
17
|
+
private hasReportedAllDiagnostics;
|
|
18
|
+
private get implementationPackageMembers();
|
|
19
|
+
constructor(analyzer: Analyzer, interfacePackage: PackageEntity, implementationPackage: PackageEntity, targetPlatform: PlatformKind);
|
|
20
|
+
ensureAllDiagnosticReported(): void;
|
|
21
|
+
getPackageVariableImplementation(entity: PackageVariableEntity): PackageVariableEntity | undefined;
|
|
22
|
+
getPackageFunctionImplementation(entity: PackageFunctionEntity): PackageFunctionEntity | undefined;
|
|
23
|
+
getPackageTypeImplementation(entity: PackageTypeEntity): PackageTypeEntity | undefined;
|
|
24
|
+
getFieldImplementation(entity: FieldEntity): FieldEntity | undefined;
|
|
25
|
+
getMethodImplementation(entity: MethodEntity): MethodEntity | undefined;
|
|
26
|
+
getOperatorImplementation(entity: OperatorEntity): OperatorEntity | undefined;
|
|
27
|
+
getConstructorImplementation(entity: ConstructorEntity): ConstructorEntity | undefined;
|
|
28
|
+
getDestructorImplementation(entity: DestructorEntity): DestructorEntity | undefined;
|
|
29
|
+
getIndexerImplementation(entity: IndexerEntity): IndexerEntity | undefined;
|
|
30
|
+
getDereferenceOperatorImplementation(entity: DereferenceOperatorEntity): DereferenceOperatorEntity | undefined;
|
|
31
|
+
static isTypeThatDoesNotRequireImplementation(entity: TypeEntity): boolean;
|
|
32
|
+
private getTypeMemberImplementations;
|
|
33
|
+
private findFieldImplementation;
|
|
34
|
+
private findMethodImplementation;
|
|
35
|
+
private findOperatorImplementation;
|
|
36
|
+
private findConstructorImplementation;
|
|
37
|
+
private findDestructorImplementation;
|
|
38
|
+
private findIndexerImplementation;
|
|
39
|
+
private findDereferenceOperatorImplementation;
|
|
40
|
+
private checkImplementationTypeMemberBasicModifier;
|
|
41
|
+
private checkImplementationTypeMemberAbstractModifier;
|
|
42
|
+
private areEqualFunctions;
|
|
43
|
+
private areEqualTypeMembersWithoutTypeParameters;
|
|
44
|
+
private areEqualTypes;
|
|
45
|
+
private areEqualSubstitutions;
|
|
46
|
+
private reportPackageDoesNotContainImplementationDiagnostic;
|
|
47
|
+
private reportTypeDoesNotContainImplementationDiagnostic;
|
|
48
|
+
}
|
|
@@ -20,6 +20,9 @@ export declare class SourceFileAnalyzer {
|
|
|
20
20
|
constructor(analyzer: Analyzer, sourceFile: project.SourceFile);
|
|
21
21
|
analyze(taskController: TaskController): Promise<Diagnostic[]>;
|
|
22
22
|
private analyzeNode;
|
|
23
|
+
private checkErrorStatement;
|
|
24
|
+
private checkBreakLoopOrContinueLoopStatement;
|
|
25
|
+
private isStatementUsedInsideLoop;
|
|
23
26
|
private checkTypeParameterList;
|
|
24
27
|
private checkTypeParameterDeclaration;
|
|
25
28
|
private checkFunctionLiteral;
|
|
@@ -36,6 +36,7 @@ export declare class TypeArgumentInferrer {
|
|
|
36
36
|
private inferFromTypes;
|
|
37
37
|
private inferToParameterType;
|
|
38
38
|
private inferToStructuredType;
|
|
39
|
+
private inferToReducedType;
|
|
39
40
|
private inferFromSubstitutions;
|
|
40
41
|
private inferToUnionType;
|
|
41
42
|
private inferFromFunctionTypes;
|