@artel/artc 0.6.25211 → 0.6.25213

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.
Files changed (62) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +20 -18
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +748 -485
  5. package/build/{chunk-EYLAO2SF.js → chunk-6UMHRF7Y.js} +3 -3
  6. package/build/{chunk-Y3KGPV3L.js → chunk-X4XDV2CH.js} +10754 -10037
  7. package/build/{chunk-5BGDYCRQ.js → chunk-YFV3TSQP.js} +9 -8
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +3 -1
  9. package/build/types/analysis/Analyzer.d.ts +33 -15
  10. package/build/types/analysis/BaseExpressionMeaning.d.ts +8 -2
  11. package/build/types/analysis/CallExpressionMeaning.d.ts +6 -1
  12. package/build/types/analysis/DiagnosticCollector.d.ts +1 -0
  13. package/build/types/analysis/EntityLocalizationHelper.d.ts +3 -1
  14. package/build/types/analysis/IdentifierExpressionMeaning.d.ts +12 -4
  15. package/build/types/analysis/Lookup.d.ts +6 -2
  16. package/build/types/analysis/PrefixUnaryOperatorResolver.d.ts +1 -3
  17. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +13 -4
  18. package/build/types/analysis/Scope.d.ts +17 -3
  19. package/build/types/analysis/SemanticContext.d.ts +18 -1
  20. package/build/types/analysis/SemanticContextBuilder.d.ts +2 -0
  21. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +1 -0
  22. package/build/types/analysis/TypeMemberLookup.d.ts +3 -3
  23. package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -2
  24. package/build/types/common/Cached.d.ts +1 -0
  25. package/build/types/common/Debug.d.ts +1 -1
  26. package/build/types/common/LocalizationHelper.d.ts +5 -2
  27. package/build/types/common/Uri.d.ts +11 -2
  28. package/build/types/common/index.d.ts +0 -1
  29. package/build/types/diagnostic/DiagnosticCode.d.ts +126 -115
  30. package/build/types/emitter/EmitterGeneratedDeclarationKind.d.ts +7 -0
  31. package/build/types/emitter/Entities.d.ts +1 -0
  32. package/build/types/emitter/EntityMap.d.ts +1 -2
  33. package/build/types/emitter/IrBuilder.d.ts +2 -0
  34. package/build/types/emitter/StatementTransformationResult.d.ts +3 -1
  35. package/build/types/emitter/ir/Nodes.d.ts +24 -22
  36. package/build/types/entities/OperatorEntity.d.ts +7 -9
  37. package/build/types/entities/OperatorKind.d.ts +19 -26
  38. package/build/types/entities/StructuredTypeEntity.d.ts +3 -3
  39. package/build/types/entities/TypeEntityMembers.d.ts +9 -14
  40. package/build/types/entities/TypeExtensionEntity.d.ts +0 -1
  41. package/build/types/entities/VariableEntity.d.ts +2 -2
  42. package/build/types/entities/index.d.ts +7 -12
  43. package/build/types/parser/Parser.d.ts +2 -2
  44. package/build/types/project/FileSystemTree.d.ts +1 -1
  45. package/build/types/services/CompletionService.d.ts +26 -20
  46. package/build/types/services/DisplayService.d.ts +42 -50
  47. package/build/types/services/NodeSemanticInfo.d.ts +6 -11
  48. package/build/types/services/SemanticTokensService.d.ts +4 -3
  49. package/build/types/tree/NodeKind.d.ts +105 -104
  50. package/build/types/tree/OperatorKind.d.ts +24 -7
  51. package/build/types/tree/green/Nodes.d.ts +28 -5
  52. package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
  53. package/build/types/tree/green/Token.d.ts +4 -3
  54. package/build/types/tree/red/Nodes.d.ts +26 -8
  55. package/build/types/tree/red/Token.d.ts +3 -2
  56. package/build/types/types/TypeMembers.d.ts +20 -29
  57. package/package.json +3 -3
  58. package/build/types/analysis/BuiltInOperators.d.ts +0 -14
  59. package/build/types/common/UriTree.d.ts +0 -41
  60. package/build/types/entities/BinaryOperatorEntity.d.ts +0 -54
  61. package/build/types/entities/UnaryOperatorEntity.d.ts +0 -37
  62. package/build/types/parser/OperatorDictionary.d.ts +0 -11
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "./chunk-EYLAO2SF.js";
3
+ } from "./chunk-6UMHRF7Y.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-Y3KGPV3L.js";
17
+ } from "./chunk-X4XDV2CH.js";
18
18
 
19
19
  // source/executor/FileSystemUri.ts
20
20
  import { platform } from "os";
@@ -22,13 +22,14 @@ import { normalize, sep } from "path";
22
22
  var FileSystemUri = class {
23
23
  static pathToUri(path) {
24
24
  path = normalize(path);
25
- if (path.startsWith(sep)) {
26
- path = path.substring(sep.length);
25
+ const segments = path.split(sep);
26
+ if (segments.length > 0 && segments[0].length === 0) {
27
+ segments.shift();
27
28
  }
28
- if (path.endsWith(sep)) {
29
- path = path.substring(0, path.length - sep.length);
29
+ if (segments.length > 0 && segments[segments.length - 1].length === 0) {
30
+ segments.pop();
30
31
  }
31
- return new Uri("file", path.split(sep));
32
+ return new Uri("file", "", segments);
32
33
  }
33
34
  static toPath(uri) {
34
35
  if (platform() === "win32") {
@@ -215,7 +216,7 @@ var NodeCompiler = class {
215
216
  const standardLibraryUri = yield this.findStandardTypeScriptLibrary(nodeModulesSearchPaths, defaultTsLibraryPath);
216
217
  if (standardLibraryUri === void 0) {
217
218
  const diagnostic = new Diagnostic(DiagnosticData.withCode(
218
- 137 /* CanNotFindTsLibDirectoryBaseSearchPaths0 */,
219
+ 148 /* CanNotFindTsLibDirectoryBaseSearchPaths0 */,
219
220
  [nodeModulesSearchPaths.map((p) => `'${p}'`).join(", ")]
220
221
  ), void 0);
221
222
  diagnostics?.addDiagnostic(diagnostic);
@@ -5,7 +5,7 @@ import { NamedMember, NamedPackageMemberEntity } from '../entities/PackageMember
5
5
  import { NamedTypeMemberEntity } from '../entities/TypeEntityMembers.js';
6
6
  import { PackageVariableEntity, ParameterVariableEntity, TypeVariableEntity } from '../entities/VariableEntity.js';
7
7
  import { VariantEntity } from '../entities/VariantEntity.js';
8
- import { AliasTypeEntity, ConstructorEntity, DestructorEntity, IndexerEntity, MethodEntity, MethodTypeEntity, PackageMethodEntity, PackageMethodTypeEntity, PackageTypeEntity, PackageVariantTypeEntity, StructuredTypeEntity, TypeMethodEntity, TypeParameterEntity, VariantTypeEntity } from '../entities/index.js';
8
+ import { AliasTypeEntity, ConstructorEntity, DestructorEntity, IndexerEntity, MethodEntity, MethodTypeEntity, OperatorEntity, PackageMethodEntity, PackageMethodTypeEntity, PackageTypeEntity, PackageVariantTypeEntity, StructuredTypeEntity, TypeMethodEntity, TypeParameterEntity, VariantTypeEntity } from '../entities/index.js';
9
9
  import { PackageName, TranslationPackage } from '../project/index.js';
10
10
  import * as tree from '../tree/index.js';
11
11
  import { Analyzer } from './Analyzer.js';
@@ -19,6 +19,7 @@ export declare class AnalyzedTranslationPackage {
19
19
  private readonly _translatedTypeEntityMembers;
20
20
  private readonly _translatedVariants;
21
21
  private readonly _methodSignatureTranslations;
22
+ private readonly _operatorSignatureTranslations;
22
23
  private readonly _methodTypeSignatureTranslations;
23
24
  private readonly _constructorSignatureTranslations;
24
25
  private readonly _indexerSignatureTranslations;
@@ -43,6 +44,7 @@ export declare class AnalyzedTranslationPackage {
43
44
  getConstructorTranslationTargets(node: tree.ConstructorTranslation): GetMultipleTranslationTargetsResult<ConstructorEntity>;
44
45
  getIndexerTranslationTargets(node: tree.IndexerTranslation): GetMultipleTranslationTargetsResult<IndexerEntity>;
45
46
  getMethodSignature(entity: MethodEntity): LocalizedSubprogramSignature.Translated | undefined;
47
+ getOperatorSignature(entity: OperatorEntity): LocalizedSubprogramSignature.Translated | undefined;
46
48
  getPackageMethodSignature(entity: PackageMethodEntity): LocalizedSubprogramSignature.Translated | undefined;
47
49
  getTypeMethodSignature(entity: TypeMethodEntity): LocalizedSubprogramSignature.Translated | undefined;
48
50
  getMethodTypeSignature(entity: MethodTypeEntity): LocalizedSubprogramSignature.Translated | undefined;
@@ -3,10 +3,11 @@ import { CancellationToken, Name, PackageLocale, Range, SearchName, WithDiagnost
3
3
  import { Diagnostic, DiagnosticAcceptor, DiagnosticLocation } from '../diagnostic/Diagnostic.js';
4
4
  import { DiagnosticCode } from '../diagnostic/DiagnosticCode.js';
5
5
  import { DiagnosticFlags, DiagnosticKind } from '../diagnostic/DiagnosticData.js';
6
+ import { BinaryOperatorKind } from '../entities/OperatorKind.js';
6
7
  import * as packageMembers from '../entities/PackageMembers.js';
7
8
  import { NamedTypeMemberEntity } from '../entities/TypeEntityMembers.js';
8
9
  import * as entities from '../entities/index.js';
9
- import { AliasTypeEntity, AnonymousMethodTypeEntity, AnonymousStructuredTypeEntity, AnonymousVariantTypeEntity, BinaryOperatorEntity, BinaryOperatorKind, ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, GetterEntity, IEntityHidingMatcher, LocalVariableEntity, MethodEntity, MethodTypeEntity, NamedTypeEntity, NestedMethodEntity, PackageAliasEntity, PackageEntity, PackageMethodEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariableEntity, PackageVariantTypeEntity, SetterEntity, SourceIndexerEntity, StructuredTypeEntity, TypeEntity, TypeExtensionEntity, TypeMemberEntityContainer, TypeMethodEntity, TypeParameterEntity, TypeVariableEntity, UnaryOperatorEntity, VariableEntity, VariantEntity, VariantTypeEntity } from '../entities/index.js';
10
+ import { AliasTypeEntity, AnonymousMethodTypeEntity, AnonymousStructuredTypeEntity, AnonymousVariantTypeEntity, ConstructorEntity, DereferenceOperatorEntity, DestructorEntity, GetterEntity, IEntityHidingMatcher, LocalVariableEntity, MethodEntity, MethodTypeEntity, NamedTypeEntity, NestedMethodEntity, OperatorEntity, PackageAliasEntity, PackageEntity, PackageMethodEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariableEntity, PackageVariantTypeEntity, SetterEntity, SourceIndexerEntity, StructuredTypeEntity, TypeEntity, TypeExtensionEntity, TypeMemberEntityContainer, TypeMethodEntity, TypeParameterEntity, TypeVariableEntity, VariableEntity, VariantEntity, VariantTypeEntity } from '../entities/index.js';
10
11
  import { ReservedIdentifierKind } from '../parser/ReservedIdentifierDictionary.js';
11
12
  import * as project from '../project/index.js';
12
13
  import { PackageName, PlatformKind, SourcePackage } from '../project/index.js';
@@ -18,7 +19,6 @@ import { AccessedMethod } from './AccessedMethod.js';
18
19
  import { AnalyzedTranslationPackage } from './AnalyzedTranslationPackage.js';
19
20
  import * as autotypeCallExpressionMeaning from './AutotypeCallExpressionMeaning.js';
20
21
  import * as baseExpressionMeaning from './BaseExpressionMeaning.js';
21
- import { BuiltInOperators } from './BuiltInOperators.js';
22
22
  import { CallArgumentToParameterMatchResult, MatchResultValueParameter } from './CallArgumentToParameterMatchResult.js';
23
23
  import * as callExpressionMeaning from './CallExpressionMeaning.js';
24
24
  import * as constructorOverloadResolver from './ConstructorOverloadResolver.js';
@@ -69,7 +69,6 @@ export declare class Analyzer {
69
69
  readonly tags: Tags;
70
70
  readonly linkedEntity: LinkedEntity;
71
71
  readonly owningPlainObjectModificationCheck: OwningPlainObjectModificationCheck;
72
- readonly builtInOperators: BuiltInOperators;
73
72
  readonly packageImports: PackageImports;
74
73
  private readonly _tsInteropInputs;
75
74
  private readonly _targetType;
@@ -153,16 +152,17 @@ export declare class Analyzer {
153
152
  packageAlias: PackageAliasEntity;
154
153
  } | undefined;
155
154
  checkExpressionDenotesMethod(expression: tree.Expression): ExpressionDenotesMethodCheckResult | undefined;
155
+ checkExpressionDenotesOperator(expression: tree.Expression): ExpressionDenotesOperatorCheckResult | undefined;
156
156
  checkExpressionDenotesPackageNameSegment(expression: tree.Expression): {
157
157
  packageTreeNode: PackageNameTreeNode;
158
158
  } | undefined;
159
159
  checkMethodBodyUsesYieldStatement(node: tree.StatementBlock): boolean;
160
160
  enumerateAspects(type: types.Type): Iterable<types.StructuredType>;
161
161
  checkTypeIsBasedOnAspect(type: types.Type, aspectEntity: StructuredTypeEntity): boolean;
162
- resolvePrefixUnaryExpressionOperator(node: tree.PrefixUnaryExpression): WithDiagnostics<FoundAnonymousDeclaration<types.UnaryOperator>>;
163
- resolveNotExpressionOperator(node: tree.NotExpression): WithDiagnostics<FoundAnonymousDeclaration<types.UnaryOperator>>;
164
- resolveBinaryExpressionUserDefinableOperator(node: tree.BinaryExpression, operatorKind: BinaryOperatorKind): WithDiagnostics<FoundAnonymousDeclaration<types.BinaryOperator>>;
165
- resolveCompoundAssignmentStatementOperator(node: tree.AssignmentStatement, operatorKind: BinaryOperatorKind): WithDiagnostics<FoundAnonymousDeclaration<types.BinaryOperator>>;
162
+ resolvePrefixUnaryExpressionOperator(node: tree.PrefixUnaryExpression): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
163
+ resolveNotExpressionOperator(node: tree.NotExpression): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
164
+ resolveBinaryExpressionUserDefinableOperator(node: tree.BinaryExpression, operatorKind: BinaryOperatorKind): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
165
+ resolveCompoundAssignmentStatementOperator(node: tree.AssignmentStatement, operatorKind: BinaryOperatorKind): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
166
166
  classifyBinaryExpressionOperator(operator: tree.BinaryExpressionOperator): BinaryExpressionOperatorClassificationResult;
167
167
  getBinaryOperatorKindIfCompoundAssignmentOperator(operator: tree.AssignmentStatementOperator): BinaryOperatorKind | undefined;
168
168
  getPackageEntities(): readonly PackageEntity[];
@@ -234,7 +234,6 @@ export declare class Analyzer {
234
234
  checkBodyOfRedefinableAliasTypeMethod(node: tree.TypeMethodDeclaration, diagnostics?: DiagnosticAcceptor): {
235
235
  redefinableMethodOfOriginalType: TypeMethodEntity;
236
236
  } | undefined;
237
- determineOperatorKind(name: Name, parameterCount: number, locale: PackageLocale): entities.OperatorKind | undefined;
238
237
  private createTsInterop;
239
238
  }
240
239
  export declare class TsInteropInputs {
@@ -249,6 +248,10 @@ export type BinaryExpressionOperatorClassificationResult = {
249
248
  operatorKind: BinaryOperatorKind;
250
249
  } | {
251
250
  kind: 'question-question';
251
+ } | {
252
+ kind: 'equals';
253
+ } | {
254
+ kind: 'not-equals';
252
255
  };
253
256
  export declare const enum SyntacticAccessKind {
254
257
  Get = 0,
@@ -265,6 +268,7 @@ declare class Type {
265
268
  ofExpression(node: tree.Expression, targetTypeHint?: TargetTypeHint): types.Type;
266
269
  ofTypeSpecifier(node: tree.TypeSpecifier): types.Type;
267
270
  ofAccessedMethod(accessedMethod: WithLocalization<AccessedMethod>): types.Type;
271
+ ofAccessedOperator(operator: WithLocalization<types.Operator>): types.Type;
268
272
  ofMethodBlockLiteral(node: tree.MethodBlockLiteral, targetTypeHint?: TargetTypeHint): types.MethodType;
269
273
  ofMethodLiteral(node: tree.MethodLiteral, targetTypeHint?: TargetTypeHint): types.MethodType;
270
274
  private ofArrayLiteral;
@@ -312,6 +316,7 @@ declare class ReturnType {
312
316
  ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): types.Type;
313
317
  ofMethodLiteral(node: tree.MethodLiteral): types.Type;
314
318
  ofTypeMethodDeclaration(node: tree.TypeMethodDeclaration): types.Type;
319
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): types.Type;
315
320
  }
316
321
  declare class Entity {
317
322
  private readonly _analyzer;
@@ -334,6 +339,7 @@ declare class Entity {
334
339
  private readonly _typeMethodEntities;
335
340
  private readonly _nestedMethodEntities;
336
341
  private readonly _constructorEntities;
342
+ private readonly _operatorEntities;
337
343
  private readonly _destructorEntities;
338
344
  private readonly _getterEntities;
339
345
  private readonly _setterEntities;
@@ -367,6 +373,7 @@ declare class Entity {
367
373
  ofPackageMethodDeclaration(node: tree.PackageMethodDeclaration): PackageMethodEntity;
368
374
  ofTypeMethodDeclaration(node: tree.TypeMethodDeclaration): TypeMethodEntity;
369
375
  ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): NestedMethodEntity;
376
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): OperatorEntity;
370
377
  ofPackageVariableGetterDeclaration(node: tree.PackageVariableGetterDeclaration): GetterEntity;
371
378
  ofTypeVariableGetterDeclaration(node: tree.TypeVariableGetterDeclaration): GetterEntity;
372
379
  ofTypeIndexedGetterDeclaration(node: tree.TypeIndexedGetterDeclaration): GetterEntity;
@@ -397,6 +404,7 @@ declare class ResultLocalVariableEntity {
397
404
  ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): LocalVariableEntity;
398
405
  ofMethodLiteral(node: tree.MethodLiteral): LocalVariableEntity;
399
406
  ofMethodBlockLiteral(node: tree.MethodBlockLiteral): LocalVariableEntity;
407
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): LocalVariableEntity;
400
408
  ofPackageVariableGetterDeclaration(node: tree.PackageVariableGetterDeclaration): LocalVariableEntity;
401
409
  ofTypeVariableGetterDeclaration(node: tree.TypeVariableGetterDeclaration): LocalVariableEntity;
402
410
  ofTypeIndexedGetterDeclaration(node: tree.TypeIndexedGetterDeclaration): LocalVariableEntity;
@@ -418,6 +426,7 @@ declare class ParamLocalVariableEntity {
418
426
  ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): VariableEntity | undefined;
419
427
  ofMethodLiteral(node: tree.MethodLiteral): VariableEntity | undefined;
420
428
  ofMethodBlockLiteral(node: tree.MethodBlockLiteral): VariableEntity | undefined;
429
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): VariableEntity | undefined;
421
430
  ofTypeConstructorDeclaration(node: tree.TypeConstructorDeclaration): VariableEntity | undefined;
422
431
  private createParamLocalVariableEntity;
423
432
  private createAccessorParamLocalVariableEntity;
@@ -438,6 +447,7 @@ declare class DestructuredParameterLocalVariableEntities {
438
447
  ofMethodBlockLiteral(node: tree.MethodBlockLiteral): readonly VariableEntity[];
439
448
  ofPackageMethodDeclaration(node: tree.PackageMethodDeclaration): readonly VariableEntity[];
440
449
  ofTypeMethodDeclaration(node: tree.TypeMethodDeclaration): readonly VariableEntity[];
450
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): readonly VariableEntity[];
441
451
  ofMethodLiteral(node: tree.MethodLiteral): readonly VariableEntity[];
442
452
  ofNestedMethodDeclaration(node: tree.NestedMethodDeclaration): readonly VariableEntity[];
443
453
  ofTypeConstructorDeclaration(node: tree.TypeConstructorDeclaration): readonly VariableEntity[];
@@ -465,6 +475,7 @@ declare class Scope {
465
475
  private readonly _variantTypeDeclarationBodyScopes;
466
476
  private readonly _aliasTypeDeclarationBodyScopes;
467
477
  private readonly _packageAliasTypeDeclarationTypeParametersScopes;
478
+ private readonly _operatorDeclarationScopes;
468
479
  private readonly _structuredTypeConstructorDeclarationScopes;
469
480
  private readonly _structuredTypeDestructorDeclarationScopes;
470
481
  private readonly _typeIndexedAccessorDeclarationParametersScopes;
@@ -491,6 +502,7 @@ declare class Scope {
491
502
  ofVariantTypeDeclarationBody(node: tree.VariantTypeDeclarationBody): scope.IScope;
492
503
  ofAliasTypeDeclarationBody(node: tree.AliasTypeDeclarationBody): scope.IScope;
493
504
  ofPackageAliasTypeDeclarationTypeParameters(node: tree.PackageAliasTypeDeclaration): scope.IScope;
505
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): scope.IScope;
494
506
  ofTypeConstructorDeclaration(node: tree.TypeConstructorDeclaration): scope.IScope;
495
507
  ofTypeDestructorDeclaration(node: tree.TypeDestructorDeclaration): scope.IScope;
496
508
  ofTypeIndexedAccessorDeclarationParameters(node: TypeIndexedAccessorDeclaration): scope.IScope;
@@ -510,13 +522,16 @@ declare class OverriddenMember {
510
522
  constructor(_analyzer: Analyzer);
511
523
  getOverriddenMethod(method: TypeMethodEntity): types.Method | undefined;
512
524
  getTheMostBaseOverriddenMethod(method: TypeMethodEntity): types.Method | undefined;
525
+ getOverriddenOperator(operator: OperatorEntity): types.Operator | undefined;
513
526
  getOverriddenVariable(variable: entities.TypeVariableEntity): types.Variable | undefined;
514
527
  getTheMostBaseOverriddenVariable(variable: entities.TypeVariableEntity): types.Variable | undefined;
515
528
  checkMethodOverridesMethod(methodInDerivedType: TypeMethodEntity, methodInBaseType: types.Method): boolean;
516
529
  checkVariableOverridesVariable(variableInDerivedType: entities.TypeVariableEntity, variableInBaseType: types.Variable): boolean;
530
+ checkOperatorOverridesOperator(operatorInDerivedType: OperatorEntity, operatorInBaseType: types.Operator): boolean;
517
531
  private findOverriddenVariableInType;
518
532
  private findOverriddenMethodInType;
519
533
  private methodSignatureTypesAreEqual;
534
+ private findOverriddenOperatorInType;
520
535
  }
521
536
  declare class Tags {
522
537
  readonly _analyzer: Analyzer;
@@ -537,11 +552,10 @@ declare class LinkedEntity {
537
552
  ofPackageMethod(entity: PackageMethodEntity, platform: PlatformKind): PackageMethodEntity | undefined;
538
553
  ofTypeVariable(entity: entities.TypeVariableEntity, platform: PlatformKind): entities.TypeVariableEntity | undefined;
539
554
  ofTypeMethod(entity: entities.TypeMethodEntity, platform: PlatformKind): entities.TypeMethodEntity | undefined;
555
+ ofOperator(entity: entities.OperatorEntity, platform: PlatformKind): entities.OperatorEntity | undefined;
540
556
  ofConstructor(entity: entities.ConstructorEntity, platform: PlatformKind): entities.ConstructorEntity | undefined;
541
557
  ofIndexer(entity: entities.IndexerEntity, platform: PlatformKind): entities.IndexerEntity | undefined;
542
558
  ofDereferenceOperator(entity: entities.DereferenceOperatorEntity, platform: PlatformKind): entities.DereferenceOperatorEntity | undefined;
543
- ofUnaryOperator(entity: entities.UnaryOperatorEntity, platform: PlatformKind): entities.UnaryOperatorEntity | undefined;
544
- ofBinaryOperator(entity: entities.BinaryOperatorEntity, platform: PlatformKind): entities.BinaryOperatorEntity | undefined;
545
559
  ofVariant(entity: VariantEntity, platform: PlatformKind): VariantEntity | undefined;
546
560
  ofGetter(entity: entities.GetterEntity, platform: PlatformKind): entities.GetterEntity | undefined;
547
561
  ofSetter(entity: entities.SetterEntity, platform: PlatformKind): entities.SetterEntity | undefined;
@@ -581,11 +595,10 @@ export declare class LinkedTypeWithMembers {
581
595
  constructor(analyzer: Analyzer, externalType: entities.TypeEntityWithMembers, targetType: entities.TypeEntityWithMembers, linkedPackage: LinkedMultiPlatformPackage);
582
596
  getLinkedVariable(entity: entities.TypeVariableEntity): entities.TypeVariableEntity | undefined;
583
597
  getLinkedMethod(entity: entities.TypeMethodEntity): entities.TypeMethodEntity | undefined;
598
+ getLinkedOperator(entity: entities.OperatorEntity): entities.OperatorEntity | undefined;
584
599
  getLinkedConstructor(entity: entities.ConstructorEntity): entities.ConstructorEntity | undefined;
585
600
  getLinkedIndexer(entity: entities.IndexerEntity): entities.IndexerEntity | undefined;
586
601
  getLinkedDereferenceOperator(entity: entities.DereferenceOperatorEntity): entities.DereferenceOperatorEntity | undefined;
587
- getLinkedUnaryOperator(entity: UnaryOperatorEntity): UnaryOperatorEntity | undefined;
588
- getLinkedBinaryOperator(entity: BinaryOperatorEntity): BinaryOperatorEntity | undefined;
589
602
  getLinkedVariant(entity: VariantEntity): VariantEntity | undefined;
590
603
  }
591
604
  declare class OwningPlainObjectModificationCheck {
@@ -634,6 +647,12 @@ export declare class ExpressionDenotesMethodCheckResult {
634
647
  get singleSuitableMethod(): WithLocalization<AccessedMethod> | undefined;
635
648
  constructor(candidates: readonly WithLocalization<AccessedMethod>[], suitableMethods: readonly WithLocalization<AccessedMethod>[]);
636
649
  }
650
+ export declare class ExpressionDenotesOperatorCheckResult {
651
+ readonly candidates: readonly WithLocalization<types.Operator>[];
652
+ readonly suitableOperators: readonly WithLocalization<types.Operator>[];
653
+ get singleSuitableOperator(): WithLocalization<types.Operator> | undefined;
654
+ constructor(candidates: readonly WithLocalization<types.Operator>[], suitableOperators: readonly WithLocalization<types.Operator>[]);
655
+ }
637
656
  export declare class NonHiddenEntityHidingMatcher implements IEntityHidingMatcher {
638
657
  matches(_hiding: entities.EntityHidingLevel): boolean;
639
658
  }
@@ -668,13 +687,12 @@ declare namespace AvailablePackage {
668
687
  export declare class DeclaredTypeMemberEntities {
669
688
  readonly variables: readonly TypeVariableEntity[];
670
689
  readonly methods: readonly TypeMethodEntity[];
690
+ readonly operators: readonly OperatorEntity[];
671
691
  readonly constructors: readonly ConstructorEntity[];
672
692
  readonly destructors: readonly DestructorEntity[];
673
693
  readonly indexers: readonly SourceIndexerEntity[];
674
694
  readonly dereferenceOperators: readonly DereferenceOperatorEntity[];
675
- readonly unaryOperators: readonly UnaryOperatorEntity[];
676
- readonly binaryOperators: readonly BinaryOperatorEntity[];
677
695
  get namedMembers(): NamedTypeMemberEntity[];
678
- constructor(variables: readonly TypeVariableEntity[], methods: readonly TypeMethodEntity[], constructors: readonly ConstructorEntity[], destructors: readonly DestructorEntity[], indexers: readonly SourceIndexerEntity[], dereferenceOperators: readonly DereferenceOperatorEntity[], unaryOperators: readonly UnaryOperatorEntity[], binaryOperators: readonly BinaryOperatorEntity[]);
696
+ constructor(variables: readonly TypeVariableEntity[], methods: readonly TypeMethodEntity[], operators: readonly OperatorEntity[], constructors: readonly ConstructorEntity[], destructors: readonly DestructorEntity[], indexers: readonly SourceIndexerEntity[], dereferenceOperators: readonly DereferenceOperatorEntity[]);
679
697
  }
680
698
  export {};
@@ -17,12 +17,13 @@ export declare class Resolver {
17
17
  private resolveBaseConstructorOrMethodAccess;
18
18
  private resolveBaseConstructorAccess;
19
19
  private resolveBaseMethodAccess;
20
+ private resolveBaseOperatorAccess;
20
21
  private resolveBaseObjectAccess;
21
22
  private invalidContextMeaning;
22
23
  private getBaseOrAliasedType;
23
- private findContainingConstructorOrTypeMethod;
24
+ private getContainingTypeMemberDeclaration;
24
25
  }
25
- export type Meaning = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | Meaning_overriddenMethodAccess | Meaning_unresolved;
26
+ export type Meaning = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | Meaning_overriddenMethodAccess | Meaning_overriddenOperatorAccess | Meaning_unresolved;
26
27
  declare class Meaning_baseObjectAccess {
27
28
  readonly type: types.Type;
28
29
  readonly kind = "base-object-access";
@@ -55,6 +56,11 @@ declare class Meaning_overriddenMethodAccess {
55
56
  readonly kind = "overridden-method-access";
56
57
  constructor(method: types.Method);
57
58
  }
59
+ declare class Meaning_overriddenOperatorAccess {
60
+ readonly operator: types.Operator;
61
+ readonly kind = "overridden-operator-access";
62
+ constructor(operator: types.Operator);
63
+ }
58
64
  declare class Meaning_unresolved {
59
65
  readonly diagnostic: Diagnostic;
60
66
  readonly kind = "unresolved";
@@ -14,12 +14,17 @@ export declare class Resolver {
14
14
  private resolveConstructorCallExpressionMeaning;
15
15
  private getNodeForDiagnostics;
16
16
  }
17
- export type Meaning = Meaning_methodCall | Meaning_objectMethodCall | Meaning_constructorCall | Meaning_unresolved;
17
+ export type Meaning = Meaning_methodCall | Meaning_operatorCall | Meaning_objectMethodCall | Meaning_constructorCall | Meaning_unresolved;
18
18
  declare class Meaning_methodCall {
19
19
  readonly method: WithLocalization<AccessedMethod>;
20
20
  readonly kind = "method-call";
21
21
  constructor(method: WithLocalization<AccessedMethod>);
22
22
  }
23
+ declare class Meaning_operatorCall {
24
+ readonly operator: WithLocalization<types.Operator>;
25
+ readonly kind = "operator-call";
26
+ constructor(operator: WithLocalization<types.Operator>);
27
+ }
23
28
  declare class Meaning_objectMethodCall {
24
29
  readonly type: types.MethodType;
25
30
  readonly kind = "object-method-call";
@@ -28,6 +28,7 @@ export declare class DiagnosticCollector {
28
28
  private checkPackageVariableGetterDeclaration;
29
29
  private checkPackageVariableSetterDeclaration;
30
30
  private checkTypeMethodDeclaration;
31
+ private checkOperatorDeclaration;
31
32
  private checkTypeVariableGetterDeclaration;
32
33
  private checkTypeVariableSetterDeclaration;
33
34
  private checkTypeIndexedGetterDeclaration;
@@ -1,15 +1,17 @@
1
1
  import { LocalizedSubprogramSignature, LocalizedTypeHeader, TypeEntityWithHeaderLocalization } from '../analysis/AnalyzedTranslationPackage.js';
2
2
  import { Analyzer } from '../analysis/index.js';
3
3
  import { Localization } from '../analysis/Localization.js';
4
- import { ConstructorEntity, DestructorEntity, IndexerEntity, MethodEntity, MethodTypeEntity } from '../entities/index.js';
4
+ import { ConstructorEntity, DestructorEntity, IndexerEntity, MethodEntity, MethodTypeEntity, OperatorEntity } from '../entities/index.js';
5
5
  import * as types from '../types/index.js';
6
6
  export declare class EntityLocalizationHelper {
7
7
  static getLocalizedMethodSignature(method: MethodEntity, localization: Localization): LocalizedSubprogramSignature;
8
+ static getLocalizedOperatorSignature(operator: OperatorEntity, localization: Localization): LocalizedSubprogramSignature;
8
9
  static getLocalizedMethodTypeSignature(methodType: MethodTypeEntity, localization: Localization): LocalizedSubprogramSignature;
9
10
  static getLocalizedConstructorSignature(constructor: ConstructorEntity, localization: Localization): LocalizedSubprogramSignature;
10
11
  static getLocalizedDestructorSignature(destructor: DestructorEntity, localization: Localization): LocalizedSubprogramSignature;
11
12
  static getLocalizedIndexerSignature(indexer: IndexerEntity, localization: Localization): LocalizedSubprogramSignature;
12
13
  static getLocalizedTypeHeader(type: TypeEntityWithHeaderLocalization, localization: Localization): LocalizedTypeHeader;
13
14
  static getLocalizedSignatureTypeOfMethod(analyzer: Analyzer, method: MethodEntity, signatureType: types.MethodType, localization: Localization): types.MethodType;
15
+ static getLocalizedSignatureTypeOfOperator(analyzer: Analyzer, operator: OperatorEntity, signatureType: types.MethodType, localization: Localization): types.MethodType;
14
16
  static localizeMethodType(analyzer: Analyzer, type: types.MethodType, localizedSignature: LocalizedSubprogramSignature): types.MethodType;
15
17
  }
@@ -1,10 +1,10 @@
1
1
  import { Name } from '../common/index.js';
2
2
  import { Diagnostic } from '../diagnostic/Diagnostic.js';
3
3
  import { NamedTypeEntity, PackageAliasEntity, VariableEntity, VariantEntity } from '../entities/index.js';
4
- import { IdentifierExpression } from '../tree/index.js';
4
+ import * as tree from '../tree/index.js';
5
5
  import * as types from '../types/index.js';
6
6
  import { AccessedMethod } from './AccessedMethod.js';
7
- import { FoundNamedDeclaration } from './FoundDeclaration.js';
7
+ import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
8
8
  import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
9
9
  import * as scope from './Scope.js';
10
10
  import * as variableAccess from './VariableAccess.js';
@@ -15,8 +15,9 @@ export declare class Resolver {
15
15
  private readonly _node;
16
16
  private readonly _targetTypeHint;
17
17
  private get semanticContext();
18
- constructor(analyzer: Analyzer, node: IdentifierExpression, targetTypeHint: TargetTypeHint | undefined);
18
+ constructor(analyzer: Analyzer, node: tree.IdentifierExpression, targetTypeHint: TargetTypeHint | undefined);
19
19
  resolve(): ResolutionResult;
20
+ private resolveOperatorAccessMeaning;
20
21
  private resolveMethodOverload;
21
22
  private createAccessedMethod;
22
23
  private convertSyntacticAccessKind;
@@ -26,7 +27,7 @@ export declare class ResolutionResult {
26
27
  readonly diagnostic?: Diagnostic | undefined;
27
28
  constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined);
28
29
  }
29
- export type Meaning = Meaning_variantAccess | Meaning_variableAccess | Meaning_methodAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | Meaning_typeAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
30
+ export type Meaning = Meaning_variantAccess | Meaning_variableAccess | Meaning_methodAccess | Meaning_operatorAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | Meaning_typeAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
30
31
  declare class Meaning_variantAccess {
31
32
  readonly variant: FoundNamedDeclaration<VariantEntity>;
32
33
  readonly kind = "variant-access";
@@ -45,6 +46,13 @@ declare class Meaning_methodAccess {
45
46
  get singleSuitableMethod(): FoundNamedDeclaration<AccessedMethod> | undefined;
46
47
  constructor(candidates: readonly FoundNamedDeclaration<AccessedMethod>[], suitableMethods: readonly FoundNamedDeclaration<AccessedMethod>[]);
47
48
  }
49
+ declare class Meaning_operatorAccess {
50
+ readonly candidates: readonly FoundAnonymousDeclaration<types.Operator>[];
51
+ readonly suitableOperators: readonly FoundAnonymousDeclaration<types.Operator>[];
52
+ readonly kind = "operator-access";
53
+ get singleSuitableOperator(): FoundAnonymousDeclaration<types.Operator> | undefined;
54
+ constructor(candidates: readonly FoundAnonymousDeclaration<types.Operator>[], suitableOperators: readonly FoundAnonymousDeclaration<types.Operator>[]);
55
+ }
48
56
  declare class Meaning_packageAliasAccess {
49
57
  readonly packageAlias: PackageAliasEntity;
50
58
  readonly kind = "package-alias-access";
@@ -1,6 +1,7 @@
1
1
  import { Query, SearchName } from '../common/index.js';
2
- import { IEntityHidingMatcher, TypeEntity, TypeExtensionEntity } from '../entities/index.js';
3
- import { FoundNamedDeclaration } from './FoundDeclaration.js';
2
+ import { IEntityHidingMatcher, OperatorKind, TypeEntity, TypeExtensionEntity } from '../entities/index.js';
3
+ import * as types from '../types/index.js';
4
+ import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
4
5
  import { IScope, NamedDeclaration, TypeOrContainerWithTypes } from './Scope.js';
5
6
  export declare class Lookup {
6
7
  private readonly _scopeChain;
@@ -10,9 +11,12 @@ export declare class Lookup {
10
11
  getTypesOrContainersWithTypesByName(name: SearchName): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
11
12
  getNamedDeclarations(): FoundNamedDeclaration<NamedDeclaration>[];
12
13
  getNamedDeclarationsByName(name: SearchName): FoundNamedDeclaration<NamedDeclaration>[];
14
+ getOperators(): FoundAnonymousDeclaration<types.Operator>[];
15
+ getOperatorsByKind(kind: OperatorKind): FoundAnonymousDeclaration<types.Operator>[];
13
16
  getTypeExtensionsByType(type: TypeEntity): TypeExtensionEntity[];
14
17
  private checkTypeOrPackageDeclarationShadowing;
15
18
  private checkNamedDeclarationShadowing;
19
+ private checkOperatorShadowing;
16
20
  }
17
21
  export declare class ScopeChain {
18
22
  private readonly _entry;
@@ -17,11 +17,9 @@ import { Analyzer } from './index.js';
17
17
  export declare class PrefixUnaryOperatorResolver {
18
18
  private readonly _analyzer;
19
19
  private readonly _node;
20
- private readonly _operandType;
21
- private get operandType();
22
20
  private get operand();
23
21
  private get operatorNode();
24
22
  private get operatorKind();
25
23
  constructor(_analyzer: Analyzer, _node: PrefixUnaryExpression | NotExpression);
26
- resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.UnaryOperator>>;
24
+ resolve(): WithDiagnostics<FoundAnonymousDeclaration<types.Operator>>;
27
25
  }
@@ -1,9 +1,9 @@
1
1
  import { Diagnostic } from '../diagnostic/Diagnostic.js';
2
2
  import { PackageTypeEntity, PackageVariableEntity, VariantEntity } from '../entities/index.js';
3
- import { PropertyAccessExpression } from '../tree/index.js';
3
+ import * as tree from '../tree/index.js';
4
4
  import * as types from '../types/index.js';
5
5
  import { AccessedMethod } from './AccessedMethod.js';
6
- import { FoundNamedDeclaration } from './FoundDeclaration.js';
6
+ import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
7
7
  import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
8
8
  import * as variableAccess from './VariableAccess.js';
9
9
  import { Analyzer, TargetTypeHint } from './index.js';
@@ -13,9 +13,10 @@ export declare class Resolver {
13
13
  private readonly _node;
14
14
  private readonly _targetTypeHint;
15
15
  private get propertySearchName();
16
+ private get isOperatorName();
16
17
  private get semanticContext();
17
18
  private get receiver();
18
- constructor(analyzer: Analyzer, node: PropertyAccessExpression, targetTypeHint: TargetTypeHint | undefined);
19
+ constructor(analyzer: Analyzer, node: tree.PropertyAccessExpression, targetTypeHint: TargetTypeHint | undefined);
19
20
  resolve(): ResolutionResult;
20
21
  private resolvePackageAliasMemberAccessMeaning;
21
22
  private resolvePackageMemberAccessMeaning;
@@ -24,6 +25,7 @@ export declare class Resolver {
24
25
  private resolveStaticMemberOrVariantAccessMeaning;
25
26
  private createAccessedMethodFromTypeMember;
26
27
  private resolveInstanceMemberAccessMeaning;
28
+ private resolveOperatorAccessMeaning;
27
29
  private resolveMethodOverload;
28
30
  private convertSyntacticAccessKind;
29
31
  }
@@ -32,7 +34,7 @@ export declare class ResolutionResult {
32
34
  readonly diagnostic?: Diagnostic | undefined;
33
35
  constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined);
34
36
  }
35
- export type Meaning = Meaning_packageVariableAccess | Meaning_packageMethodAccess | Meaning_packageTypeAccess | Meaning_packageNameSegmentAccess | Meaning_variantAccess | Meaning_staticVariableAccess | Meaning_staticMethodAccess | Meaning_instanceVariableAccess | Meaning_instanceMethodAccess | Meaning_unresolved;
37
+ export type Meaning = Meaning_packageVariableAccess | Meaning_packageMethodAccess | Meaning_packageTypeAccess | Meaning_packageNameSegmentAccess | Meaning_variantAccess | Meaning_staticVariableAccess | Meaning_staticMethodAccess | Meaning_instanceVariableAccess | Meaning_instanceMethodAccess | Meaning_operatorAccess | Meaning_unresolved;
36
38
  declare class Meaning_packageVariableAccess {
37
39
  readonly variable: FoundNamedDeclaration<PackageVariableEntity>;
38
40
  readonly access: variableAccess.VariableAccess;
@@ -92,6 +94,13 @@ declare class Meaning_instanceMethodAccess {
92
94
  get singleSuitableMethod(): FoundNamedDeclaration<AccessedMethod> | undefined;
93
95
  constructor(candidates: readonly FoundNamedDeclaration<AccessedMethod>[], suitableMethods: readonly FoundNamedDeclaration<AccessedMethod>[]);
94
96
  }
97
+ declare class Meaning_operatorAccess {
98
+ readonly candidates: readonly FoundAnonymousDeclaration<types.Operator>[];
99
+ readonly suitableOperators: readonly FoundAnonymousDeclaration<types.Operator>[];
100
+ readonly kind = "operator-access";
101
+ get singleSuitableOperator(): FoundAnonymousDeclaration<types.Operator> | undefined;
102
+ constructor(candidates: readonly FoundAnonymousDeclaration<types.Operator>[], suitableOperators: readonly FoundAnonymousDeclaration<types.Operator>[]);
103
+ }
95
104
  declare class Meaning_unresolved {
96
105
  readonly kind = "unresolved";
97
106
  }
@@ -1,9 +1,9 @@
1
1
  import { Name, PackageLocale, SearchName } from '../common/index.js';
2
- import { AliasTypeEntity, EntityHidingLevel, IEntityHidingMatcher, MethodEntity, NamedTypeEntity, PackageAliasEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariantTypeEntity, TypeEntity, TypeExtensionEntity, TypeParameterEntity, VariableEntity, VariantEntity } from '../entities/index.js';
2
+ import { AliasTypeEntity, EntityHidingLevel, IEntityHidingMatcher, MethodEntity, NamedTypeEntity, OperatorKind, PackageAliasEntity, PackageMethodTypeEntity, PackageStructuredTypeEntity, PackageVariantTypeEntity, TypeEntity, TypeExtensionEntity, TypeParameterEntity, VariableEntity, VariantEntity } from '../entities/index.js';
3
3
  import * as tree from '../tree/index.js';
4
4
  import * as types from '../types/index.js';
5
5
  import { Analyzer } from './Analyzer.js';
6
- import { FoundNamedDeclaration } from './FoundDeclaration.js';
6
+ import { FoundAnonymousDeclaration, FoundNamedDeclaration } from './FoundDeclaration.js';
7
7
  import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
8
8
  import { Lookup } from './Lookup.js';
9
9
  import { TypeMemberLookup } from './TypeMemberLookup.js';
@@ -12,6 +12,8 @@ export interface IScope {
12
12
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
13
13
  getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
14
14
  getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
15
+ getOperators(hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
16
+ getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
15
17
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
16
18
  }
17
19
  export type TypeOrContainerWithTypes = TypeOrContainerWithTypes_type | TypeOrContainerWithTypes_packageAlias | TypeOrContainerWithTypes_packageNameSegment;
@@ -233,6 +235,8 @@ export declare class SourceFileScope implements IScope {
233
235
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
234
236
  getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
235
237
  getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
238
+ getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
239
+ getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
236
240
  getTypeExtensionsByType(type: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
237
241
  private convertPackageMembersTypeDeclaration;
238
242
  private convertPackageMemberToNamedDeclaration;
@@ -256,6 +260,8 @@ export declare class GenericScope implements IScope {
256
260
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
257
261
  getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
258
262
  getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
263
+ getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
264
+ getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
259
265
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
260
266
  private checkHiding;
261
267
  }
@@ -273,6 +279,8 @@ export declare class ParameterDeclarationsScope implements IScope {
273
279
  getTypesOrContainersWithTypesByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
274
280
  getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
275
281
  getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
282
+ getOperators(_hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
283
+ getOperatorsByKind(_kind: OperatorKind, _hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
276
284
  getTypeExtensionsByType(typeEntity: TypeEntity, hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
277
285
  private checkHiding;
278
286
  }
@@ -284,6 +292,8 @@ export declare class StructuredTypeBodyScope implements IScope {
284
292
  getTypesOrContainersWithTypesByName(_name: SearchName, _hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
285
293
  getNamedDeclarations(hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
286
294
  getNamedDeclarationsByName(name: SearchName, hidingMatcher: IEntityHidingMatcher | undefined): FoundNamedDeclaration<NamedDeclaration>[];
295
+ getOperators(hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
296
+ getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
287
297
  getTypeExtensionsByType(_typeEntity: TypeEntity, _hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
288
298
  private convertNamedMember;
289
299
  }
@@ -301,9 +311,13 @@ export declare class TypeExtensionBodyScope implements IScope {
301
311
  getTypesOrContainersWithTypesByName(_name: SearchName, _hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<TypeOrContainerWithTypes>[];
302
312
  getNamedDeclarations(hidingMatcher: IEntityHidingMatcher | undefined): FoundNamedDeclaration<NamedDeclaration>[];
303
313
  getNamedDeclarationsByName(name: SearchName, hidingMatcher?: IEntityHidingMatcher): FoundNamedDeclaration<NamedDeclaration>[];
314
+ getOperators(hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
315
+ getOperatorsByKind(kind: OperatorKind, hidingMatcher?: IEntityHidingMatcher): FoundAnonymousDeclaration<types.Operator>[];
304
316
  getTypeExtensionsByType(_typeEntity: TypeEntity, _hidingMatcher?: IEntityHidingMatcher): TypeExtensionEntity[];
305
- private convertTypeExtensionMember;
317
+ private convertNamedTypeExtensionMember;
318
+ private convertTypeExtensionOperator;
306
319
  private convertExtendedTypeMember;
320
+ private checkOperatorShadowing;
307
321
  private checkNamedDeclarationShadowing;
308
322
  }
309
323
  export {};
@@ -26,7 +26,7 @@ export interface SemanticContext {
26
26
  getScopeLookup(): Lookup;
27
27
  getHidingMatcher(): IEntityHidingMatcher;
28
28
  }
29
- export type SubprogramInfo = SubprogramInfo.Method | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.MethodLiteral;
29
+ export type SubprogramInfo = SubprogramInfo.Method | SubprogramInfo.Operator | SubprogramInfo.Constructor | SubprogramInfo.Destructor | SubprogramInfo.Getter | SubprogramInfo.Setter | SubprogramInfo.PackageConstructor | SubprogramInfo.PackageEntryPoint | SubprogramInfo.MethodLiteral;
30
30
  export declare namespace SubprogramInfo {
31
31
  export class Method implements ISubprogramInfo {
32
32
  readonly kind = "method";
@@ -36,6 +36,14 @@ export declare namespace SubprogramInfo {
36
36
  getReturnType(): types.Type | undefined;
37
37
  isGenerator(): boolean;
38
38
  }
39
+ export class Operator implements ISubprogramInfo {
40
+ readonly kind = "operator";
41
+ private readonly _analyzer;
42
+ private readonly _node;
43
+ constructor(analyzer: Analyzer, node: tree.OperatorDeclaration);
44
+ getReturnType(): types.Type | undefined;
45
+ isGenerator(): boolean;
46
+ }
39
47
  export class Constructor implements ISubprogramInfo {
40
48
  readonly kind = "constructor";
41
49
  private readonly _analyzer;
@@ -240,6 +248,15 @@ export declare class PackageEntryPointSemanticContext extends SemanticContextWit
240
248
  constructor(analyzer: Analyzer, node: tree.PackageEntryPointDeclaration, parentContext: SemanticContext);
241
249
  getContainingSubprogram(): SubprogramInfo | undefined;
242
250
  }
251
+ export declare class OperatorSemanticContext extends SemanticContextWithParent {
252
+ private readonly _analyzer;
253
+ private readonly _node;
254
+ private readonly _scopeChain;
255
+ private readonly _subprogramInfo;
256
+ constructor(analyzer: Analyzer, node: tree.OperatorDeclaration, parentContext: SemanticContext);
257
+ getScopeChain(): ScopeChain;
258
+ getContainingSubprogram(): SubprogramInfo | undefined;
259
+ }
243
260
  export declare class ConstructorSemanticContext extends SemanticContextWithParent {
244
261
  private readonly _analyzer;
245
262
  private readonly _node;
@@ -20,6 +20,7 @@ export declare class SemanticContextBuilder {
20
20
  * Контекст заголовка метода. Включает параметры-типы и параметры-значения (в зависимости от указанного `hint`).
21
21
  */
22
22
  ofMethodDeclarationHeader(node: MethodDeclaration, hint: 'type-parameters' | 'value-parameters'): SemanticContext;
23
+ ofOperatorDeclaration(node: tree.OperatorDeclaration): SemanticContext;
23
24
  ofTypeDeclarationBody(node: TypeDeclarationBody): SemanticContext;
24
25
  /**
25
26
  * Контекст заголовка типа. Включает параметры типа.
@@ -44,6 +45,7 @@ export declare class SemanticContextBuilder {
44
45
  private ofChildOfTypeDeclarationBodyWithMemberBlock;
45
46
  private ofChildOfMethodTypeDeclarationBody;
46
47
  private ofChildOfMethodLiteral;
48
+ private ofOperatorDeclarationChild;
47
49
  private ofTypeConstructorDeclarationChild;
48
50
  private ofTypeDestructorDeclarationChild;
49
51
  private ofTypeIndexedGetterDeclarationChild;