@artel/artc 0.6.25219 → 0.6.25221
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 +4 -4
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +248 -184
- package/build/{chunk-AIY75NR5.js → chunk-5F65ZJE3.js} +3 -3
- package/build/{chunk-IYSH7MAQ.js → chunk-X7TMUZ4C.js} +2754 -1292
- package/build/{chunk-QLTGS2V2.js → chunk-XMV7LOUY.js} +3 -3
- package/build/types/analysis/Analyzer.d.ts +49 -2
- package/build/types/analysis/ControlFlowGraphBuilder.d.ts +121 -0
- package/build/types/analysis/ControlFlowGraphVisualizer.d.ts +12 -0
- package/build/types/analysis/DiagnosticCollector.d.ts +3 -0
- package/build/types/analysis/NodeTypeUtils.d.ts +9 -1
- package/build/types/analysis/TypeNarrower.d.ts +57 -0
- package/build/types/common/Range.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +131 -123
- package/build/types/diagnostic/DiagnosticData.d.ts +2 -1
- package/build/types/parser/Scanner.d.ts +1 -0
- package/build/types/services/CompletionService.d.ts +2 -1
- package/build/types/services/DisplayService.d.ts +4 -2
- package/build/types/services/NodeSemanticInfo.d.ts +4 -2
- package/build/types/tree/NodeKind.d.ts +45 -44
- package/build/types/tree/green/Nodes.d.ts +77 -67
- package/build/types/tree/green/Token.d.ts +1 -1
- package/build/types/tree/green/Utils.d.ts +1 -1
- package/build/types/tree/red/Nodes.d.ts +54 -42
- package/build/types/tree/red/Utils.d.ts +1 -1
- package/build/types/types/TypeFactory.d.ts +2 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
Compiler
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-5F65ZJE3.js";
|
4
4
|
import {
|
5
5
|
ArtelVersion,
|
6
6
|
Cached,
|
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
__async,
|
15
15
|
performanceMeasurementStageNames,
|
16
16
|
performanceMeasurementStages
|
17
|
-
} from "./chunk-
|
17
|
+
} from "./chunk-X7TMUZ4C.js";
|
18
18
|
|
19
19
|
// source/executor/FileSystemUri.ts
|
20
20
|
import { platform } from "os";
|
@@ -216,7 +216,7 @@ var NodeCompiler = class {
|
|
216
216
|
const standardLibraryUri = yield this.findStandardTypeScriptLibrary(nodeModulesSearchPaths, defaultTsLibraryPath);
|
217
217
|
if (standardLibraryUri === void 0) {
|
218
218
|
const diagnostic = new Diagnostic(DiagnosticData.withCode(
|
219
|
-
|
219
|
+
125 /* CanNotFindTsLibDirectoryBaseSearchPaths0 */,
|
220
220
|
[nodeModulesSearchPaths.map((p) => `'${p}'`).join(", ")]
|
221
221
|
), void 0);
|
222
222
|
diagnostics?.addDiagnostic(diagnostic);
|
@@ -21,6 +21,7 @@ import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.
|
|
21
21
|
import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
|
22
22
|
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
23
23
|
import * as constructorOverloadResolver from './ConstructorOverloadResolver.js';
|
24
|
+
import { ControlFlowGraphBuildResult } from './ControlFlowGraphBuilder.js';
|
24
25
|
import { DeclarationsUsageCountResult } from './DeclarationsUsageCounter.js';
|
25
26
|
import * as dereferenceExpressionMeaning from './DereferenceExpressionMeaning.js';
|
26
27
|
import { FoundAnonymousDeclaration } from './FoundDeclaration.js';
|
@@ -93,6 +94,7 @@ export declare class Analyzer {
|
|
93
94
|
private readonly _linkedMultiPlatformPackagesByPlatform;
|
94
95
|
private readonly _bodyUsesYieldStatementCheckResults;
|
95
96
|
private readonly _namedDeclarationsUsageCountResults;
|
97
|
+
private readonly _controlFlowGraphs;
|
96
98
|
get tsInterop(): TsInteropContext;
|
97
99
|
constructor(compilation: project.Compilation, tsInteropInputs: TsInteropInputs);
|
98
100
|
getProjectSourceFile(node: tree.SourceFile): project.SourceFile;
|
@@ -105,6 +107,7 @@ export declare class Analyzer {
|
|
105
107
|
referencedType: types.Type;
|
106
108
|
} | undefined;
|
107
109
|
isTypeAssignableTo(source: types.Type, target: types.Type): boolean;
|
110
|
+
getTypeAssignabilityFlags(source: types.Type, target: types.Type): TypeAssignabilityFlags;
|
108
111
|
checkStatementBlockInvokesAsyncMethods(node: tree.StatementBlock): boolean;
|
109
112
|
getSyntacticAccessKind(node: tree.Expression): SyntacticAccessKind;
|
110
113
|
getTypeMemberEntityContainer(node: tree.TypeMemberDeclaration): e.TypeMemberEntityContainer;
|
@@ -128,8 +131,37 @@ export declare class Analyzer {
|
|
128
131
|
resolveTag(node: tree.Tag): tagMeaning.ResolutionResult;
|
129
132
|
getObjectExpressionMeaning(node: tree.ObjectExpression): objectExpressionMeaning.Meaning;
|
130
133
|
getBaseExpressionMeaning(node: tree.BaseExpression): baseExpressionMeaning.Meaning;
|
131
|
-
|
132
|
-
|
134
|
+
/**
|
135
|
+
* Проверяет, является ли выражение цепочкой доступов через `?`, заканчивающейся выражением, тип которого допускает
|
136
|
+
* `пусто`.
|
137
|
+
*
|
138
|
+
* Пример:
|
139
|
+
* ```artel
|
140
|
+
* а?.б
|
141
|
+
* а?[1]
|
142
|
+
* а?^
|
143
|
+
* а?()
|
144
|
+
* (а)?.б
|
145
|
+
* ```
|
146
|
+
*
|
147
|
+
* где тип переменной `а` допускает `пусто`.
|
148
|
+
*/
|
149
|
+
isExpressionValidOptionalChaining(node: tree.Expression): boolean;
|
150
|
+
/**
|
151
|
+
* Проверяет, является ли выражение цепочкой доступов через `?`.
|
152
|
+
*
|
153
|
+
* Пример:
|
154
|
+
* ```artel
|
155
|
+
* а?.б
|
156
|
+
* а?[1]
|
157
|
+
* а?^
|
158
|
+
* а?()
|
159
|
+
* (а)?.б
|
160
|
+
* ```
|
161
|
+
*/
|
162
|
+
isExpressionOptionalChainingSyntactically(node: tree.Expression): boolean;
|
163
|
+
isExpressionValidOutermostOptionalChaining(node: tree.Expression): boolean;
|
164
|
+
makeNoneAssignableToTypeIfExpressionValidOutermostOptionalChaining(type: types.Type, node: tree.Expression): types.Type;
|
133
165
|
checkIdentifierNameIsReserved(name: string, locale: PackageLocale): ReservedIdentifierKind | undefined;
|
134
166
|
getReservedIdentifierName(reservedIdentifierKind: ReservedIdentifierKind, locale: PackageLocale): string;
|
135
167
|
createNameFromIdentifier(node: tree.Identifier): Name;
|
@@ -200,6 +232,7 @@ export declare class Analyzer {
|
|
200
232
|
* - Т: Объект? -> нет, поскольку в качестве конкретного типа, заменяющего параметр, может быть использован тип, исключающий `пусто`.
|
201
233
|
*/
|
202
234
|
isNoneAssignableToType(type: types.Type): boolean;
|
235
|
+
excludeTypeFromUnion(initialType: types.Type, excludedType: types.Type): types.Type;
|
203
236
|
isMethodValueParameterVariadic(entity: e.VariableEntity): boolean;
|
204
237
|
getDefaultTypeParameterConstraint(): types.Type;
|
205
238
|
getOriginalSignatureTypeOfMethodEntity(entity: e.MethodEntity): types.MethodType;
|
@@ -229,6 +262,7 @@ export declare class Analyzer {
|
|
229
262
|
checkBodyOfRedefinableAliasTypeMethod(node: tree.TypeMethodDeclaration, diagnostics?: DiagnosticAcceptor): {
|
230
263
|
redefinableMethodOfOriginalType: e.TypeMethodEntity;
|
231
264
|
} | undefined;
|
265
|
+
getControlFlowGraph(sourceFile: project.SourceFile): ControlFlowGraphBuildResult;
|
232
266
|
private createTsInterop;
|
233
267
|
}
|
234
268
|
export declare class TsInteropInputs {
|
@@ -299,6 +333,7 @@ declare class Type {
|
|
299
333
|
private getTargetlessMethodBlockLiteralType;
|
300
334
|
private inferMethodLiteralTypeFromNodeWithFallbackToTargetType;
|
301
335
|
private inferMethodLiteralTypeFromNode;
|
336
|
+
private getNarrowedTypeIfNarrowableReference;
|
302
337
|
}
|
303
338
|
declare class ReturnType {
|
304
339
|
private readonly _analyzer;
|
@@ -387,6 +422,9 @@ declare class Entity {
|
|
387
422
|
private createTypeIndexerEntities;
|
388
423
|
private areTypeIndexedAccessorDeclarationsEqual;
|
389
424
|
}
|
425
|
+
type EntityClassMembers = Entity[keyof Entity];
|
426
|
+
type GetNodesFromMethodsParameter<T> = T extends (node: infer TNode) => e.Entity ? (TNode extends tree.Node ? TNode : never) : never;
|
427
|
+
export type NodeCorrespondingToEntity = GetNodesFromMethodsParameter<EntityClassMembers>;
|
390
428
|
declare class ResultLocalVariableEntity {
|
391
429
|
private readonly _analyzer;
|
392
430
|
private readonly _entities;
|
@@ -571,6 +609,15 @@ declare class OwningPlainObjectModificationCheck {
|
|
571
609
|
private checkReceiverModifiesPlainObjectRecursively;
|
572
610
|
private nodeBelongsToPlainObjectDeclaration;
|
573
611
|
}
|
612
|
+
export declare enum TypeAssignabilityFlags {
|
613
|
+
NotAssignable = 1,
|
614
|
+
Identity = 2,
|
615
|
+
DerivedToBase = 4,
|
616
|
+
MethodTypes = 8,
|
617
|
+
ImplicitConversion = 16,
|
618
|
+
First = 1,
|
619
|
+
Last = 16
|
620
|
+
}
|
574
621
|
declare class PackageImports {
|
575
622
|
private readonly _analyzer;
|
576
623
|
private readonly _packagesAvailableForImport;
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
2
|
+
import { SourceFile } from '../project/SourceFile.js';
|
3
|
+
import * as tree from '../tree/index.js';
|
4
|
+
export declare class ControlFlowGraphBuilder {
|
5
|
+
private readonly _sourceFile;
|
6
|
+
private readonly _controlFlowNodeByReference;
|
7
|
+
private readonly _unreachableCodeDiagnostics;
|
8
|
+
private _isInRebuildingFinallyClauseGraphMode;
|
9
|
+
private _currentPredecessor;
|
10
|
+
private _currentContinueLoopTarget;
|
11
|
+
private _currentBreakLoopTarget;
|
12
|
+
private _currentErrorTarget;
|
13
|
+
private _currentReturnTarget;
|
14
|
+
constructor(sourceFile: SourceFile);
|
15
|
+
build(): ControlFlowGraphBuildResult;
|
16
|
+
private visitNode;
|
17
|
+
private visitAssignmentStatement;
|
18
|
+
private visitIfStatement;
|
19
|
+
private visitWhileStatement;
|
20
|
+
private visitLoopStatement;
|
21
|
+
private visitForStatement;
|
22
|
+
private visitContinueLoopStatement;
|
23
|
+
private visitBreakLoopStatement;
|
24
|
+
private visitSwitchStatement;
|
25
|
+
private visitTryStatement;
|
26
|
+
private visitReturnStatement;
|
27
|
+
private visitErrorStatement;
|
28
|
+
private visitLocalVariableDeclaration;
|
29
|
+
private visitWhenTernaryExpression;
|
30
|
+
private visitCondition;
|
31
|
+
private visitBinaryExpression;
|
32
|
+
private visitPrefixUnaryExpressionInCondition;
|
33
|
+
private visitIsExpressionInCondition;
|
34
|
+
private setAssignmentAsCurrentPredecessor;
|
35
|
+
private visitChildren;
|
36
|
+
private addUnreachableCodeDiagnostic;
|
37
|
+
}
|
38
|
+
export declare class ControlFlowGraphBuildResult {
|
39
|
+
readonly controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, ControlFlowNode>;
|
40
|
+
readonly unreachableCodeDiagnostics: readonly Diagnostic[];
|
41
|
+
constructor(controlFlowNodeByReference: ReadonlyMap<NarrowableReferenceExpression, ControlFlowNode>, unreachableCodeDiagnostics: readonly Diagnostic[]);
|
42
|
+
}
|
43
|
+
export type NarrowableExpression = tree.IdentifierExpression | tree.PropertyAccessExpression | tree.ObjectExpression;
|
44
|
+
export declare function isNarrowableExpression(node: tree.Node): node is tree.Expression;
|
45
|
+
export type NarrowableReferenceExpression = tree.IdentifierExpression | tree.PropertyAccessExpression | tree.ObjectExpression;
|
46
|
+
export declare function isNarrowableReferenceExpression(node: tree.Node): node is NarrowableReferenceExpression;
|
47
|
+
export type ControlFlowNode = ControlFlowNode.Start | ControlFlowNode.Condition | ControlFlowNode.Assignment | ControlFlowNode.Split | ControlFlowNode.Loop | ControlFlowNode.Unreachable;
|
48
|
+
export declare namespace ControlFlowNode {
|
49
|
+
abstract class ControlFlowNodeBase {
|
50
|
+
protected abstract thisAsNode: ControlFlowNode;
|
51
|
+
/**
|
52
|
+
* Для отладочных целей.
|
53
|
+
*/
|
54
|
+
generateVisualizationCode(): string;
|
55
|
+
}
|
56
|
+
/**
|
57
|
+
* Начальный узел, не имеющий предшественников.
|
58
|
+
*/
|
59
|
+
export class Start extends ControlFlowNodeBase {
|
60
|
+
readonly kind = "start";
|
61
|
+
get debuggerDisplay(): string;
|
62
|
+
protected get thisAsNode(): ControlFlowNode;
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Хранит информацию об истинности некоторого условия. Например, если условие `а != пусто` истинно, то из типа
|
66
|
+
* переменной `а` необходимо исключить тип `Пусто`.
|
67
|
+
*/
|
68
|
+
export class Condition extends ControlFlowNodeBase {
|
69
|
+
readonly predecessor: ControlFlowNode;
|
70
|
+
readonly syntaxNode: ConditionControlFlowNodeExpression;
|
71
|
+
readonly isTrue: boolean;
|
72
|
+
readonly kind = "condition";
|
73
|
+
get debuggerDisplay(): string;
|
74
|
+
protected get thisAsNode(): ControlFlowNode;
|
75
|
+
constructor(predecessor: ControlFlowNode, syntaxNode: ConditionControlFlowNodeExpression, isTrue: boolean);
|
76
|
+
}
|
77
|
+
/**
|
78
|
+
* Создаётся в местах присваивания значений в переменную, а также объявления переменных с начальным значением.
|
79
|
+
* После присваивания тип переменной меняется на тип выражения справа от равно.
|
80
|
+
*/
|
81
|
+
export class Assignment extends ControlFlowNodeBase {
|
82
|
+
readonly predecessor: ControlFlowNode;
|
83
|
+
readonly syntaxNode: tree.AssignmentStatement | tree.LocalVariableDeclaration;
|
84
|
+
readonly kind = "assignment";
|
85
|
+
get debuggerDisplay(): string;
|
86
|
+
protected get thisAsNode(): ControlFlowNode;
|
87
|
+
constructor(predecessor: ControlFlowNode, syntaxNode: tree.AssignmentStatement | tree.LocalVariableDeclaration);
|
88
|
+
}
|
89
|
+
/**
|
90
|
+
* Вспомогательный узел, использующийся в местах, где происходит разветвление графа потока управления. Тип переменной
|
91
|
+
* для этого узла определяется как союзный тип из типов переменных в предшествующих узлах.
|
92
|
+
*/
|
93
|
+
export class Split extends ControlFlowNodeBase {
|
94
|
+
readonly predecessors: readonly ControlFlowNode[];
|
95
|
+
readonly kind = "split";
|
96
|
+
get debuggerDisplay(): string;
|
97
|
+
protected get thisAsNode(): ControlFlowNode;
|
98
|
+
constructor(predecessors: readonly ControlFlowNode[]);
|
99
|
+
}
|
100
|
+
/**
|
101
|
+
* Используется для циклов (пока, цикл - повтор пока, для-из). Отличается от узла `Split` тем, что предшествующие
|
102
|
+
* узлы, указанные в массиве `loopingPredecessors` образуют циклы в графе потока управления.
|
103
|
+
*/
|
104
|
+
export abstract class Loop extends ControlFlowNodeBase {
|
105
|
+
readonly kind = "loop";
|
106
|
+
get debuggerDisplay(): string;
|
107
|
+
protected get thisAsNode(): ControlFlowNode;
|
108
|
+
abstract predecessor: ControlFlowNode;
|
109
|
+
abstract loopingPredecessors: readonly ControlFlowNode[];
|
110
|
+
}
|
111
|
+
/**
|
112
|
+
* Обозначает недостижимый код.
|
113
|
+
*/
|
114
|
+
export class Unreachable extends ControlFlowNodeBase {
|
115
|
+
readonly kind = "unreachable";
|
116
|
+
get debuggerDisplay(): string;
|
117
|
+
protected get thisAsNode(): ControlFlowNode;
|
118
|
+
}
|
119
|
+
export {};
|
120
|
+
}
|
121
|
+
export type ConditionControlFlowNodeExpression = tree.BinaryExpression | tree.IsExpression;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { ControlFlowNode } from './ControlFlowGraphBuilder.js';
|
2
|
+
export declare class ControlFlowGraphVisualizer {
|
3
|
+
/**
|
4
|
+
* Создаёт описание графа на языке Dot.
|
5
|
+
*
|
6
|
+
* Визуализацию графа можно посмотреть по этой ссылке:
|
7
|
+
* https://dreampuf.github.io/GraphvizOnline/?engine=dot#digraph%20%7B%20%7D
|
8
|
+
*/
|
9
|
+
static generateGraphDescriptionInDotLanguage(startNode: ControlFlowNode): string;
|
10
|
+
private static getLabel;
|
11
|
+
private static createGetIdFunction;
|
12
|
+
}
|
@@ -18,6 +18,8 @@ export declare class DiagnosticCollector {
|
|
18
18
|
constructor(analyzer: Analyzer, sourceFile: project.SourceFile, cancellationToken: CancellationToken | undefined);
|
19
19
|
collect(): Promise<Diagnostic[]>;
|
20
20
|
private collectNodeDiagnostics;
|
21
|
+
private checkDereferenceExpression;
|
22
|
+
private checkIndexedAccessExpression;
|
21
23
|
private checkCallExpression;
|
22
24
|
private addNotTranslatedPackageMembersDiagnostics;
|
23
25
|
private collectNotTranslatedPackageMembers;
|
@@ -60,6 +62,7 @@ export declare class DiagnosticCollector {
|
|
60
62
|
private checkAssignmentToObjectExpression;
|
61
63
|
private checkAssignmentToDereferenceExpression;
|
62
64
|
private checkAssignmentToIndexedAccessExpression;
|
65
|
+
private checkOptionalChainingIsUsedOnTheLeftSideOfAssignment;
|
63
66
|
private checkGenericSpecializationExpression;
|
64
67
|
private checkMethodSpecialization;
|
65
68
|
private checkTypeSpecialization;
|
@@ -11,11 +11,13 @@ export declare class NodeTypeUtils {
|
|
11
11
|
static isTypeSpecifier(node: tree.Node): node is tree.TypeSpecifier;
|
12
12
|
static isMethodDeclaration(node: tree.Node): node is MethodDeclaration;
|
13
13
|
static isVariableDeclaration(node: tree.Node): node is VariableDeclaration;
|
14
|
+
static isVariantTypeDeclaration(node: tree.Node): node is VariantTypeDeclaration;
|
15
|
+
static isSubprogramDeclaration(node: tree.Node): node is SubprogramDeclaration;
|
16
|
+
static isNoneLiteral(node: tree.Node): boolean;
|
14
17
|
}
|
15
18
|
export type PackageTypeDeclaration = tree.PackageAliasTypeDeclaration | tree.PackageMethodTypeDeclaration | tree.PackageStructuredTypeDeclaration | tree.PackageVariantTypeDeclaration;
|
16
19
|
export type StructuredTypeDeclaration = tree.PackageStructuredTypeDeclaration | tree.AnonymousStructuredTypeDeclaration;
|
17
20
|
export type VariantTypeDeclaration = tree.PackageVariantTypeDeclaration | tree.AnonymousVariantTypeDeclaration;
|
18
|
-
export declare function isVariantTypeDeclaration(node: tree.Node): node is VariantTypeDeclaration;
|
19
21
|
export type MethodTypeDeclaration = tree.PackageMethodTypeDeclaration | tree.AnonymousMethodTypeDeclaration;
|
20
22
|
export type MethodDeclaration = tree.PackageMethodDeclaration | tree.NestedMethodDeclaration | tree.TypeMethodDeclaration;
|
21
23
|
export type TypeDeclaration = StructuredTypeDeclaration | VariantTypeDeclaration | MethodTypeDeclaration | tree.PackageAliasTypeDeclaration | tree.TypeParameterDeclaration;
|
@@ -27,3 +29,9 @@ export type PackageVariableAccessorDeclaration = tree.PackageVariableGetterDecla
|
|
27
29
|
export type TypeVariableAccessorDeclaration = tree.TypeVariableGetterDeclaration | tree.TypeVariableSetterDeclaration;
|
28
30
|
export type TypeIndexedAccessorDeclaration = tree.TypeIndexedGetterDeclaration | tree.TypeIndexedSetterDeclaration;
|
29
31
|
export type TypeDereferencedVariableAccessorDeclaration = tree.TypeDereferencedVariableGetterDeclaration | tree.TypeDereferencedVariableSetterDeclaration;
|
32
|
+
type Declaration = tree.PackageMemberDeclaration | tree.TypeMemberDeclaration | tree.LocalVariableDeclaration | tree.EnumerationVariableDeclaration | tree.ErrorVariableDeclaration | tree.NestedMethodDeclaration | TypeDeclaration;
|
33
|
+
type SubprogramDeclarationInternal<T extends Declaration = Declaration> = T extends {
|
34
|
+
block: tree.StatementBlock | undefined;
|
35
|
+
} ? T : never;
|
36
|
+
export type SubprogramDeclaration = SubprogramDeclarationInternal | tree.MethodLiteral | tree.MethodBlockLiteral;
|
37
|
+
export {};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { LocalVariableEntity, PackageVariableEntity, ParameterVariableEntity } from '../entities/VariableEntity.js';
|
2
|
+
import * as types from '../types/index.js';
|
3
|
+
import { Analyzer } from './Analyzer.js';
|
4
|
+
import { ControlFlowNode, NarrowableReferenceExpression } from './ControlFlowGraphBuilder.js';
|
5
|
+
export declare class TypeNarrower {
|
6
|
+
private readonly _analyzer;
|
7
|
+
private readonly _referenceExpression;
|
8
|
+
private readonly _initialType;
|
9
|
+
private readonly _controlFlowNode;
|
10
|
+
private _reference;
|
11
|
+
private readonly _typeByNode;
|
12
|
+
constructor(analyzer: Analyzer, referenceExpression: NarrowableReferenceExpression, initialType: types.Type, controlFlowNode: ControlFlowNode);
|
13
|
+
getType(): types.Type;
|
14
|
+
private getTypeAtControlFlowNode;
|
15
|
+
private getTypeAtCondition;
|
16
|
+
private getTypeAtAssignment;
|
17
|
+
private getTypeAtSplit;
|
18
|
+
private getTypeAtLoop;
|
19
|
+
private getTypeAtComparisonWithNone;
|
20
|
+
private getTypeAtIsExpression;
|
21
|
+
private addTypeIfUnique;
|
22
|
+
private isSameReferenceAsNarrowedExpression;
|
23
|
+
private unwrapExpression;
|
24
|
+
private getReferenceAtNodeIfNarrowable;
|
25
|
+
private getReferenceAtNode;
|
26
|
+
private getReferenceAtLocalVariableDeclaration;
|
27
|
+
}
|
28
|
+
export type NarrowableReference = NarrowableReference.LocalOrPackageVariable | NarrowableReference.InstanceTypeVariable | NarrowableReference.StaticTypeVariable | NarrowableReference.Object;
|
29
|
+
export declare namespace NarrowableReference {
|
30
|
+
export class LocalOrPackageVariable implements INarrowableReference {
|
31
|
+
readonly entity: LocalVariableEntity | ParameterVariableEntity | PackageVariableEntity;
|
32
|
+
readonly kind = "local-or-package-variable";
|
33
|
+
constructor(entity: LocalVariableEntity | ParameterVariableEntity | PackageVariableEntity);
|
34
|
+
equals(other: NarrowableReference): boolean;
|
35
|
+
}
|
36
|
+
export class InstanceTypeVariable implements INarrowableReference {
|
37
|
+
readonly variable: types.Variable;
|
38
|
+
readonly receiver: NarrowableReference;
|
39
|
+
readonly kind = "instance-type-variable";
|
40
|
+
constructor(variable: types.Variable, receiver: NarrowableReference);
|
41
|
+
equals(other: NarrowableReference): boolean;
|
42
|
+
}
|
43
|
+
export class StaticTypeVariable implements INarrowableReference {
|
44
|
+
readonly variable: types.Variable;
|
45
|
+
readonly kind = "static-type-variable";
|
46
|
+
constructor(variable: types.Variable);
|
47
|
+
equals(other: NarrowableReference): boolean;
|
48
|
+
}
|
49
|
+
export class Object implements INarrowableReference {
|
50
|
+
readonly kind = "object";
|
51
|
+
equals(other: NarrowableReference): boolean;
|
52
|
+
}
|
53
|
+
interface INarrowableReference {
|
54
|
+
equals(other: NarrowableReference): boolean;
|
55
|
+
}
|
56
|
+
export {};
|
57
|
+
}
|
@@ -1,125 +1,133 @@
|
|
1
1
|
export declare enum DiagnosticCode {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
2
|
+
UnterminatedToken = 0,
|
3
|
+
UnterminatedMultiLineComment = 1,
|
4
|
+
UnterminatedNumber = 2,
|
5
|
+
UnterminatedTextOrTextTemplate = 3,
|
6
|
+
UnterminatedQuotedIdentifier = 4,
|
7
|
+
IdentifierExpected = 5,
|
8
|
+
TypeNameExpected = 6,
|
9
|
+
PackageNameExpected = 7,
|
10
|
+
TypeMemberDeclarationExpected = 8,
|
11
|
+
SourceFileMemberExpected = 9,
|
12
|
+
EnumerationVariableDeclarationExpected = 10,
|
13
|
+
StatementExpected = 11,
|
14
|
+
ExpressionExpected = 12,
|
15
|
+
BaseTypeNameExpected = 13,
|
16
|
+
TypeSpecifierExpected = 14,
|
17
|
+
TypeBodyExpected = 15,
|
18
|
+
MethodCallArgumentExpected = 16,
|
19
|
+
IndexedAccessArgumentExpected = 17,
|
20
|
+
TagArgumentExpected = 18,
|
21
|
+
TypeParameterExpected = 19,
|
22
|
+
ParameterExpected = 20,
|
23
|
+
RunStatementClauseExpected = 21,
|
24
|
+
CatchClauseOrFinallyClauseExpected = 22,
|
25
|
+
PackageImportExpected = 23,
|
26
|
+
UsingDirectiveOrSourceFileMemberExpected = 24,
|
27
|
+
TypeMemberTranslationExpected = 25,
|
28
|
+
TranslationExpected = 26,
|
29
|
+
Expected0But1Found = 27,
|
30
|
+
InvalidTextTemplateLiteral = 28,
|
31
|
+
RunKeywordCreationKeywordOrModifierListExpected = 29,
|
32
|
+
ModifierListExpected = 30,
|
33
|
+
HidingLevelExpected = 31,
|
34
|
+
ParameterNameCanContainOnlyOneBackQuote = 32,
|
35
|
+
FieldNameCanContainOnlyTwoBackQuote = 33,
|
36
|
+
BackQuotesCanOnlyBeUsedInParameterAndFieldNames = 34,
|
37
|
+
NameThatMatchesKeywordMustBeEnclosedInSingleQuotes = 35,
|
38
|
+
TagNameExpected = 36,
|
39
|
+
TypeCannotBeUsedAsValue = 37,
|
40
|
+
PackageMemberNotFound = 38,
|
41
|
+
TypeMemberNotFound = 39,
|
42
|
+
CannotAccessStaticMembersOnTypeParameter = 40,
|
43
|
+
IndexerOfTheSpecifiedTypeNotFound = 41,
|
44
|
+
DereferenceOperatorOfTheSpecifiedTypeNotFound = 42,
|
45
|
+
IndexerNotFound = 43,
|
46
|
+
CannotCreateInstanceOfAspect = 44,
|
47
|
+
CannotCreateInstanceOfTypeParameter = 45,
|
48
|
+
CannotCreateInstanceOfUnresolvedType = 46,
|
49
|
+
TypeConstructorNotFound = 47,
|
50
|
+
CannotInvokeExpression = 48,
|
51
|
+
NamedArgumentExpectedButPositionalArgumentFound = 49,
|
52
|
+
ParameterWithGivenNameNotFound = 50,
|
53
|
+
ArgumentForParameterAlreadyPassed = 51,
|
54
|
+
PackageAliasCannotBeUsedAsValue = 52,
|
55
|
+
PackageNameCannotBeUsedAsValue = 53,
|
56
|
+
UnknownVariable = 54,
|
57
|
+
UnknownType = 55,
|
58
|
+
TypeWithArity0NotFound = 56,
|
59
|
+
VariableUsedBeforeBeingDeclared = 57,
|
60
|
+
Type0IsNotAssignableToType1 = 58,
|
61
|
+
VariableNotFound = 59,
|
62
|
+
MethodNotFound = 60,
|
63
|
+
UnknownPackage = 61,
|
64
|
+
CannotAssignValueToExpression = 62,
|
65
|
+
NotEveryRequiredParameterIsProvidedWithArgument = 63,
|
66
|
+
ParameterForPositionalArgumentNotFound = 64,
|
67
|
+
CannotDetermineTargetTypeToCallTheConstructor = 65,
|
68
|
+
AmbiguousAccess = 66,
|
69
|
+
PackageNameConflictsWithDeclarationName = 67,
|
70
|
+
CanNotAssignValueToContextVariable = 68,
|
71
|
+
ExpectedPackageNameOrAliasButFoundType = 69,
|
72
|
+
TypeExpected = 70,
|
73
|
+
NameOfTypeOrPackageNotFound = 71,
|
74
|
+
TypeIsNotATag = 72,
|
75
|
+
ExpressionOfType0CanNotBeUsedForEnumeration = 73,
|
76
|
+
Operator0IsNotDefinedForTypes1And2 = 74,
|
77
|
+
Operator0IsNotDefinedForType1 = 75,
|
78
|
+
VariantMustHaveAssociatedValue = 76,
|
79
|
+
PackageMemberOrPackageNotFound = 77,
|
80
|
+
TranslationsCanOnlyBeDeclaredInTranslationPackage = 78,
|
81
|
+
UnknownTranslatedPackage0 = 79,
|
82
|
+
BaseCannotBeUsedInThisContext = 80,
|
83
|
+
OverriddenMethodNotFound = 81,
|
84
|
+
ObjectCannotBeUsedInThisContext = 82,
|
85
|
+
BaseCannotBeUsedAsAnExpressionInItself = 83,
|
86
|
+
InterfacePackageMustNotContainImplementation = 84,
|
87
|
+
InterfacePackageVariablesMustNotHaveInitializers = 85,
|
88
|
+
BodyIsMissing = 86,
|
89
|
+
AbstractTypeMembersMustNotHaveBody = 87,
|
90
|
+
AbstractVariablesMustNotHaveInitializers = 88,
|
91
|
+
PackageIsAlreadyImportedInAnotherLanguage = 89,
|
92
|
+
OnlySubprogramsWithReturnTypeCanReturnValue = 90,
|
93
|
+
MethodsUsingYieldStatementCanNotReturnValue = 91,
|
94
|
+
YieldStatementCanNotBeUsedInAnonymousMethods = 92,
|
95
|
+
YieldStatementCanNotBeUsedHere = 93,
|
96
|
+
MethodsUsingYieldStatementMustHaveEnumerableAsReturnType = 94,
|
97
|
+
YieldStatementCanNotBeUsedInTryStatementThatHasCatchClause = 95,
|
98
|
+
YieldStatementCanNotBeUsedInFinallyClause = 96,
|
99
|
+
SubprogramMustReturnValue = 97,
|
100
|
+
ResultVariableCanNotBeUsedInMethodsUsingYieldStatement = 98,
|
101
|
+
TypeAliasReferencesItself = 99,
|
102
|
+
TypeParameterHasCircularConstraint = 100,
|
103
|
+
BaseTypeCausesInheritanceCycle = 101,
|
104
|
+
OnlyGenericTypesAndFunctionsCanBeSpecialized = 102,
|
105
|
+
Expected0TypeArguments = 103,
|
106
|
+
ExpectedFrom0To1TypeArguments = 104,
|
107
|
+
Type0IsNotAssignableToConstraint1 = 105,
|
108
|
+
VariableIsDeclaredButNotUsed = 106,
|
109
|
+
DefaultConstructorArgumentsMustBeNamed = 107,
|
110
|
+
IncorrectBodyOfRedefinableAliasTypeMethod = 108,
|
111
|
+
TheFollowingDeclarationsAreNotTranslated0 = 109,
|
112
|
+
TheFollowingDeclarationAreNotTranslated0And1More = 110,
|
113
|
+
OperatorMustNotBeStatic = 111,
|
114
|
+
Operator0MustNotHaveParameters = 112,
|
115
|
+
Operator0MustHaveOneParameter = 113,
|
116
|
+
Operator0MustHaveNoMoreThanOneParameter = 114,
|
117
|
+
CorrespondingRedefinableTypeMemberNotFound = 115,
|
118
|
+
ConstructorCanNotBeRedefinable = 116,
|
119
|
+
ConstructorCanNotBeRedefined = 117,
|
120
|
+
AsyncMethodCanOnlyBeCalledFromMethodMarkedWithAsyncModifier = 118,
|
121
|
+
TagNotFound = 119,
|
122
|
+
TypeOrMethodNameExpected = 120,
|
123
|
+
PackageNameOrAliasExpected = 121,
|
124
|
+
ExpressionCanBeNone = 122,
|
125
|
+
NoneAwareAccessCanNotBeUsedOnTheLeftHandSideOfAssignmentStatement = 123,
|
126
|
+
UnreachableCode = 124,
|
127
|
+
CanNotFindTsLibDirectoryBaseSearchPaths0 = 125,
|
128
|
+
SourceFile0IsNotPartOfThePackageAndWontBeLoaded = 126,
|
129
|
+
ProgramWithoutMainPackageCanNotBeCompiled = 127,
|
130
|
+
JsonConfigurationValidationError = 128,
|
131
|
+
StandardPackage0NotFound = 129,
|
132
|
+
Declaration0NotFoundInStandardPackage1 = 130
|
125
133
|
}
|