@artel/artc 0.6.25230 → 0.6.25231
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 +6 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +12 -12
- package/build/{chunk-3LHZOXTJ.js → chunk-BG2YEIQO.js} +2 -2
- package/build/{chunk-ZUIGWNN5.js → chunk-S7CAJWX2.js} +1676 -396
- package/build/{chunk-WS3ILL2L.js → chunk-VQ5GGKF7.js} +1 -1
- package/build/types/analysis/Analyzer.d.ts +4 -3
- package/build/types/analysis/DiagnosticCollector.d.ts +1 -0
- package/build/types/analysis/FindModifier.d.ts +1 -0
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +1 -1
- package/build/types/analysis/ModifierFlags.d.ts +6 -1
- package/build/types/analysis/ModifierValidator.d.ts +83 -0
- package/build/types/analysis/TypeMemberConflictsValidator.d.ts +22 -0
- package/build/types/common/ArrayUtils.d.ts +8 -0
- package/build/types/common/index.d.ts +1 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +57 -29
- package/build/types/entities/DereferenceOperatorEntity.d.ts +3 -0
- package/build/types/entities/IndexerEntity.d.ts +3 -0
- package/build/types/entities/StructuredTypeEntity.d.ts +13 -13
- package/build/types/entities/VariableEntity.d.ts +4 -0
- package/build/types/entities/index.d.ts +2 -1
- package/build/types/project/SourcePackage.d.ts +7 -7
- package/build/types/services/NodeSemanticInfo.d.ts +1 -1
- package/build/types/tree/green/Nodes.d.ts +2 -2
- package/build/types/tree/red/Nodes.d.ts +1 -1
- package/build/types/ts-interop/Entities.d.ts +5 -5
- package/build/types/types/StructuredType.d.ts +2 -0
- package/package.json +1 -1
@@ -70,18 +70,18 @@ var __yieldStar = (value) => {
|
|
70
70
|
};
|
71
71
|
|
72
72
|
// source/common/PackageDialect.ts
|
73
|
-
var PackageDialect = /* @__PURE__ */ ((
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
return
|
73
|
+
var PackageDialect = /* @__PURE__ */ ((PackageDialect7) => {
|
74
|
+
PackageDialect7[PackageDialect7["Mixed"] = 0] = "Mixed";
|
75
|
+
PackageDialect7[PackageDialect7["Usual"] = 1] = "Usual";
|
76
|
+
PackageDialect7[PackageDialect7["Special"] = 2] = "Special";
|
77
|
+
return PackageDialect7;
|
78
78
|
})(PackageDialect || {});
|
79
79
|
|
80
80
|
// source/common/PackageLocale.ts
|
81
|
-
var PackageLocale = /* @__PURE__ */ ((
|
82
|
-
|
83
|
-
|
84
|
-
return
|
81
|
+
var PackageLocale = /* @__PURE__ */ ((PackageLocale16) => {
|
82
|
+
PackageLocale16[PackageLocale16["En"] = 0] = "En";
|
83
|
+
PackageLocale16[PackageLocale16["Ru"] = 1] = "Ru";
|
84
|
+
return PackageLocale16;
|
85
85
|
})(PackageLocale || {});
|
86
86
|
var locales = [
|
87
87
|
{ locale: 0 /* En */, code: "en", names: ["english", "\u0430\u043D\u0433\u043B\u0438\u0439\u0441\u043A\u0438\u0439"] },
|
@@ -617,7 +617,7 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
617
617
|
};
|
618
618
|
|
619
619
|
// source/common/Constants.ts
|
620
|
-
var ArtelVersion = true ? "0.6.
|
620
|
+
var ArtelVersion = true ? "0.6.25231" : "";
|
621
621
|
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel"];
|
622
622
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
623
623
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
@@ -745,6 +745,21 @@ var AccessKind = /* @__PURE__ */ ((AccessKind2) => {
|
|
745
745
|
return AccessKind2;
|
746
746
|
})(AccessKind || {});
|
747
747
|
|
748
|
+
// source/common/ArrayUtils.ts
|
749
|
+
var ArrayUtils = class {
|
750
|
+
/**
|
751
|
+
* Удаляет элемент из массива по заданному индексу.
|
752
|
+
*
|
753
|
+
* Работает быстрее, чем `array.splice(index, 1)`, и не выделяет память для массива удалённых элементов.
|
754
|
+
*/
|
755
|
+
static removeElement(array, index) {
|
756
|
+
for (let i = index; i < array.length - 1; i++) {
|
757
|
+
array[i] = array[i + 1];
|
758
|
+
}
|
759
|
+
array.pop();
|
760
|
+
}
|
761
|
+
};
|
762
|
+
|
748
763
|
// source/common/Path.ts
|
749
764
|
function getFileExtension(nameOrPath) {
|
750
765
|
const dotIndex = nameOrPath.lastIndexOf(".");
|
@@ -6852,7 +6867,7 @@ var MemberAccessExpression = class extends BaseNode {
|
|
6852
6867
|
get dotToken() {
|
6853
6868
|
return this.children[1];
|
6854
6869
|
}
|
6855
|
-
get
|
6870
|
+
get memberName() {
|
6856
6871
|
return this.children[2];
|
6857
6872
|
}
|
6858
6873
|
get thisAsNode() {
|
@@ -6862,7 +6877,7 @@ var MemberAccessExpression = class extends BaseNode {
|
|
6862
6877
|
return [
|
6863
6878
|
this.green.expression.toRed(childRangeStart(this, 0), this),
|
6864
6879
|
this.green.dotToken.toRed(childRangeStart(this, 1), this),
|
6865
|
-
this.green.
|
6880
|
+
this.green.memberName.toRed(childRangeStart(this, 2), this)
|
6866
6881
|
];
|
6867
6882
|
}
|
6868
6883
|
};
|
@@ -10823,10 +10838,10 @@ var PrefixUnaryExpression2 = class extends BaseNode2 {
|
|
10823
10838
|
}
|
10824
10839
|
};
|
10825
10840
|
var MemberAccessExpression2 = class extends BaseNode2 {
|
10826
|
-
constructor(expression, dotToken,
|
10841
|
+
constructor(expression, dotToken, memberName) {
|
10827
10842
|
super();
|
10828
10843
|
this.kind = 78 /* MemberAccessExpression */;
|
10829
|
-
this.children = [expression, dotToken,
|
10844
|
+
this.children = [expression, dotToken, memberName];
|
10830
10845
|
}
|
10831
10846
|
get expression() {
|
10832
10847
|
return this.children[0];
|
@@ -10834,7 +10849,7 @@ var MemberAccessExpression2 = class extends BaseNode2 {
|
|
10834
10849
|
get dotToken() {
|
10835
10850
|
return this.children[1];
|
10836
10851
|
}
|
10837
|
-
get
|
10852
|
+
get memberName() {
|
10838
10853
|
return this.children[2];
|
10839
10854
|
}
|
10840
10855
|
get thisAsNode() {
|
@@ -12708,35 +12723,63 @@ var DiagnosticCode = /* @__PURE__ */ ((DiagnosticCode2) => {
|
|
12708
12723
|
DiagnosticCode2[DiagnosticCode2["IncorrectBodyOfBasicAliasTypeMethod"] = 276] = "IncorrectBodyOfBasicAliasTypeMethod";
|
12709
12724
|
DiagnosticCode2[DiagnosticCode2["TheFollowingDeclarationsAreNotTranslated0"] = 277] = "TheFollowingDeclarationsAreNotTranslated0";
|
12710
12725
|
DiagnosticCode2[DiagnosticCode2["TheFollowingDeclarationAreNotTranslated0And1More"] = 278] = "TheFollowingDeclarationAreNotTranslated0And1More";
|
12711
|
-
DiagnosticCode2[DiagnosticCode2["
|
12712
|
-
DiagnosticCode2[DiagnosticCode2["
|
12713
|
-
DiagnosticCode2[DiagnosticCode2["
|
12714
|
-
DiagnosticCode2[DiagnosticCode2["
|
12715
|
-
DiagnosticCode2[DiagnosticCode2["
|
12716
|
-
DiagnosticCode2[DiagnosticCode2["
|
12717
|
-
DiagnosticCode2[DiagnosticCode2["
|
12718
|
-
DiagnosticCode2[DiagnosticCode2["
|
12719
|
-
DiagnosticCode2[DiagnosticCode2["
|
12720
|
-
DiagnosticCode2[DiagnosticCode2["
|
12721
|
-
DiagnosticCode2[DiagnosticCode2["
|
12722
|
-
DiagnosticCode2[DiagnosticCode2["
|
12723
|
-
DiagnosticCode2[DiagnosticCode2["
|
12724
|
-
DiagnosticCode2[DiagnosticCode2["
|
12725
|
-
DiagnosticCode2[DiagnosticCode2["
|
12726
|
-
DiagnosticCode2[DiagnosticCode2["
|
12727
|
-
DiagnosticCode2[DiagnosticCode2["
|
12728
|
-
DiagnosticCode2[DiagnosticCode2["
|
12729
|
-
DiagnosticCode2[DiagnosticCode2["
|
12730
|
-
DiagnosticCode2[DiagnosticCode2["
|
12731
|
-
DiagnosticCode2[DiagnosticCode2["
|
12732
|
-
DiagnosticCode2[DiagnosticCode2["
|
12733
|
-
DiagnosticCode2[DiagnosticCode2["
|
12734
|
-
DiagnosticCode2[DiagnosticCode2["
|
12735
|
-
DiagnosticCode2[DiagnosticCode2["
|
12736
|
-
DiagnosticCode2[DiagnosticCode2["
|
12737
|
-
DiagnosticCode2[DiagnosticCode2["
|
12738
|
-
DiagnosticCode2[DiagnosticCode2["
|
12739
|
-
DiagnosticCode2[DiagnosticCode2["
|
12726
|
+
DiagnosticCode2[DiagnosticCode2["OperatorFunction0MustNotHaveParameters"] = 279] = "OperatorFunction0MustNotHaveParameters";
|
12727
|
+
DiagnosticCode2[DiagnosticCode2["OperatorFunction0MustHaveOneParameter"] = 280] = "OperatorFunction0MustHaveOneParameter";
|
12728
|
+
DiagnosticCode2[DiagnosticCode2["OperatorFunction0MustHaveNoMoreThanOneParameter"] = 281] = "OperatorFunction0MustHaveNoMoreThanOneParameter";
|
12729
|
+
DiagnosticCode2[DiagnosticCode2["CorrespondingBasicTypeMemberNotFound"] = 282] = "CorrespondingBasicTypeMemberNotFound";
|
12730
|
+
DiagnosticCode2[DiagnosticCode2["AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier"] = 283] = "AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier";
|
12731
|
+
DiagnosticCode2[DiagnosticCode2["TagNotFound"] = 284] = "TagNotFound";
|
12732
|
+
DiagnosticCode2[DiagnosticCode2["TypeOrFunctionNameExpected"] = 285] = "TypeOrFunctionNameExpected";
|
12733
|
+
DiagnosticCode2[DiagnosticCode2["PackageNameOrAliasExpected"] = 286] = "PackageNameOrAliasExpected";
|
12734
|
+
DiagnosticCode2[DiagnosticCode2["ExpressionCanBeNone"] = 287] = "ExpressionCanBeNone";
|
12735
|
+
DiagnosticCode2[DiagnosticCode2["TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator"] = 288] = "TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator";
|
12736
|
+
DiagnosticCode2[DiagnosticCode2["UnreachableCode"] = 289] = "UnreachableCode";
|
12737
|
+
DiagnosticCode2[DiagnosticCode2["RecursionOccurredWhileCalculatingTheTypeOfTheExpression"] = 290] = "RecursionOccurredWhileCalculatingTheTypeOfTheExpression";
|
12738
|
+
DiagnosticCode2[DiagnosticCode2["RecursionOccurredWhileInferringTheTypeOfTheVariable"] = 291] = "RecursionOccurredWhileInferringTheTypeOfTheVariable";
|
12739
|
+
DiagnosticCode2[DiagnosticCode2["ScopeAlreadyContainsDeclarationWithTheSameName"] = 292] = "ScopeAlreadyContainsDeclarationWithTheSameName";
|
12740
|
+
DiagnosticCode2[DiagnosticCode2["ScopeAlreadyContainsFunctionWithTheSameNameAndParameterTypes"] = 293] = "ScopeAlreadyContainsFunctionWithTheSameNameAndParameterTypes";
|
12741
|
+
DiagnosticCode2[DiagnosticCode2["ParameterName0ConflictsWithAutomaticallyGeneratedVariableName"] = 294] = "ParameterName0ConflictsWithAutomaticallyGeneratedVariableName";
|
12742
|
+
DiagnosticCode2[DiagnosticCode2["PackageAlreadyContainsDeclarationWithTheSameName"] = 295] = "PackageAlreadyContainsDeclarationWithTheSameName";
|
12743
|
+
DiagnosticCode2[DiagnosticCode2["PackageAlreadyContainsFunctionWithTheSameNameAndParameterTypes"] = 296] = "PackageAlreadyContainsFunctionWithTheSameNameAndParameterTypes";
|
12744
|
+
DiagnosticCode2[DiagnosticCode2["PackageAlreadyContainsTypeWithTheSameNameAndSameOrIntersectingTypeParameterCount"] = 297] = "PackageAlreadyContainsTypeWithTheSameNameAndSameOrIntersectingTypeParameterCount";
|
12745
|
+
DiagnosticCode2[DiagnosticCode2["PackageAliasWithTheSameNameAlreadyExits"] = 298] = "PackageAliasWithTheSameNameAlreadyExits";
|
12746
|
+
DiagnosticCode2[DiagnosticCode2["PackageCanHaveOnlyEntryPoint"] = 299] = "PackageCanHaveOnlyEntryPoint";
|
12747
|
+
DiagnosticCode2[DiagnosticCode2["PackageCanHaveOnlyOneConstructor"] = 300] = "PackageCanHaveOnlyOneConstructor";
|
12748
|
+
DiagnosticCode2[DiagnosticCode2["TypeAlreadyContainsDeclarationWithTheSameName"] = 301] = "TypeAlreadyContainsDeclarationWithTheSameName";
|
12749
|
+
DiagnosticCode2[DiagnosticCode2["TypeAlreadyContainsMethodWithTheSameNameAndParameterTypes"] = 302] = "TypeAlreadyContainsMethodWithTheSameNameAndParameterTypes";
|
12750
|
+
DiagnosticCode2[DiagnosticCode2["TypeAlreadyContainsConstructorWithTheSameParameterTypes"] = 303] = "TypeAlreadyContainsConstructorWithTheSameParameterTypes";
|
12751
|
+
DiagnosticCode2[DiagnosticCode2["TypeAlreadyContainsOperatorFunctionWithTheSameParameterTypes"] = 304] = "TypeAlreadyContainsOperatorFunctionWithTheSameParameterTypes";
|
12752
|
+
DiagnosticCode2[DiagnosticCode2["TypeAlreadyContainsIndexerWithTheSameParameterTypes"] = 305] = "TypeAlreadyContainsIndexerWithTheSameParameterTypes";
|
12753
|
+
DiagnosticCode2[DiagnosticCode2["TypeCanHaveOnlyOneDestructor"] = 306] = "TypeCanHaveOnlyOneDestructor";
|
12754
|
+
DiagnosticCode2[DiagnosticCode2["TypeCanHaveOnlyOneDereferenceOperator"] = 307] = "TypeCanHaveOnlyOneDereferenceOperator";
|
12755
|
+
DiagnosticCode2[DiagnosticCode2["VariableIsUsedBeforeItsDeclaration"] = 308] = "VariableIsUsedBeforeItsDeclaration";
|
12756
|
+
DiagnosticCode2[DiagnosticCode2["VariableMayNotHasBeenAssignedBeforeUsage"] = 309] = "VariableMayNotHasBeenAssignedBeforeUsage";
|
12757
|
+
DiagnosticCode2[DiagnosticCode2["NotAllCodePathsReturnAValueAndResultLocalVariableMayNotHasBeenAssigned"] = 310] = "NotAllCodePathsReturnAValueAndResultLocalVariableMayNotHasBeenAssigned";
|
12758
|
+
DiagnosticCode2[DiagnosticCode2["WriteFunctionHasNoCorrespondingReadFunction"] = 311] = "WriteFunctionHasNoCorrespondingReadFunction";
|
12759
|
+
DiagnosticCode2[DiagnosticCode2["TypeCanNotHaveMultipleBaseObjectTypes"] = 312] = "TypeCanNotHaveMultipleBaseObjectTypes";
|
12760
|
+
DiagnosticCode2[DiagnosticCode2["TypeThatIsNotMarkedAsBasicCanNotBeUsedAsBaseType"] = 313] = "TypeThatIsNotMarkedAsBasicCanNotBeUsedAsBaseType";
|
12761
|
+
DiagnosticCode2[DiagnosticCode2["PlainObjectTypeCanNotBeUsedAsBaseType"] = 314] = "PlainObjectTypeCanNotBeUsedAsBaseType";
|
12762
|
+
DiagnosticCode2[DiagnosticCode2["ThisTypeIsAlreadyListedInBaseTypeList"] = 315] = "ThisTypeIsAlreadyListedInBaseTypeList";
|
12763
|
+
DiagnosticCode2[DiagnosticCode2["OnlyObjectAndAspectTypesCanBeUsedAsBaseTypes"] = 316] = "OnlyObjectAndAspectTypesCanBeUsedAsBaseTypes";
|
12764
|
+
DiagnosticCode2[DiagnosticCode2["PlainObjectTypeCanHaveOnlyAspectsAsBaseTypes"] = 317] = "PlainObjectTypeCanHaveOnlyAspectsAsBaseTypes";
|
12765
|
+
DiagnosticCode2[DiagnosticCode2["AspectTypeCanHaveOnlyAspectsAsBaseTypes"] = 318] = "AspectTypeCanHaveOnlyAspectsAsBaseTypes";
|
12766
|
+
DiagnosticCode2[DiagnosticCode2["ModifierListAlreadyContains0Modifier"] = 319] = "ModifierListAlreadyContains0Modifier";
|
12767
|
+
DiagnosticCode2[DiagnosticCode2["ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier"] = 320] = "ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier";
|
12768
|
+
DiagnosticCode2[DiagnosticCode2["_0ModifierIsNotAllowedHere"] = 321] = "_0ModifierIsNotAllowedHere";
|
12769
|
+
DiagnosticCode2[DiagnosticCode2["DeclarationCanNotBePlacedInGroupHaving0Modifier"] = 322] = "DeclarationCanNotBePlacedInGroupHaving0Modifier";
|
12770
|
+
DiagnosticCode2[DiagnosticCode2["PackageConstructorDeclarationCanNotHaveModifiers"] = 323] = "PackageConstructorDeclarationCanNotHaveModifiers";
|
12771
|
+
DiagnosticCode2[DiagnosticCode2["PackageEntryPointDeclarationCanNotHaveModifiers"] = 324] = "PackageEntryPointDeclarationCanNotHaveModifiers";
|
12772
|
+
DiagnosticCode2[DiagnosticCode2["TranslationsCanNotHaveModifiers"] = 325] = "TranslationsCanNotHaveModifiers";
|
12773
|
+
DiagnosticCode2[DiagnosticCode2["AbstractModifierCanOnlyBeUsedInAbstractObjectTypes"] = 326] = "AbstractModifierCanOnlyBeUsedInAbstractObjectTypes";
|
12774
|
+
DiagnosticCode2[DiagnosticCode2["BasicModifierCanOnlyBeUsedInObjectTypesAspectTypesAndTypeAliases"] = 327] = "BasicModifierCanOnlyBeUsedInObjectTypesAspectTypesAndTypeAliases";
|
12775
|
+
DiagnosticCode2[DiagnosticCode2["OverrideModifierCanOnlyBeUsedInObjectAndAspectTypes"] = 328] = "OverrideModifierCanOnlyBeUsedInObjectAndAspectTypes";
|
12776
|
+
DiagnosticCode2[DiagnosticCode2["_0ModifierCanNotBeUsedWith1Modifier"] = 329] = "_0ModifierCanNotBeUsedWith1Modifier";
|
12777
|
+
DiagnosticCode2[DiagnosticCode2["VariantDeclarationCanNotHaveHiddenModifier"] = 330] = "VariantDeclarationCanNotHaveHiddenModifier";
|
12778
|
+
DiagnosticCode2[DiagnosticCode2["BasicModifierCanOnlyBeAppliedToObjectTypes"] = 331] = "BasicModifierCanOnlyBeAppliedToObjectTypes";
|
12779
|
+
DiagnosticCode2[DiagnosticCode2["AbstractModifierCanOnlyBeAppliedToObjectTypes"] = 332] = "AbstractModifierCanOnlyBeAppliedToObjectTypes";
|
12780
|
+
DiagnosticCode2[DiagnosticCode2["NotBasicObjectTypesCanNotHaveBasicMembers"] = 333] = "NotBasicObjectTypesCanNotHaveBasicMembers";
|
12781
|
+
DiagnosticCode2[DiagnosticCode2["WriteFunctionMustHaveTheSameModifiersAsReadFunction"] = 334] = "WriteFunctionMustHaveTheSameModifiersAsReadFunction";
|
12782
|
+
DiagnosticCode2[DiagnosticCode2["WriteFunctionMustHaveTheSameOrMoreRestrictiveHidingLevelThenReadFunction"] = 335] = "WriteFunctionMustHaveTheSameOrMoreRestrictiveHidingLevelThenReadFunction";
|
12740
12783
|
DiagnosticCode2[DiagnosticCode2["CannotFindTsLibDirectoryBaseSearchPaths0"] = 401] = "CannotFindTsLibDirectoryBaseSearchPaths0";
|
12741
12784
|
DiagnosticCode2[DiagnosticCode2["SourceFile0IsNotPartOfThePackageAndWontBeLoaded"] = 402] = "SourceFile0IsNotPartOfThePackageAndWontBeLoaded";
|
12742
12785
|
DiagnosticCode2[DiagnosticCode2["ProgramWithoutMainPackageCannotBeCompiled"] = 403] = "ProgramWithoutMainPackageCannotBeCompiled";
|
@@ -12898,35 +12941,63 @@ var englishErrorMessages = {
|
|
12898
12941
|
[276 /* IncorrectBodyOfBasicAliasTypeMethod */]: "Body of overridden method declared in alias type must consist of a call to base method of original type with same parameters and return type.",
|
12899
12942
|
[277 /* TheFollowingDeclarationsAreNotTranslated0 */]: "The following declarations are not translated: {0}.",
|
12900
12943
|
[278 /* TheFollowingDeclarationAreNotTranslated0And1More */]: "The following declarations are not translated: {0} and {1} more.",
|
12901
|
-
[279 /*
|
12902
|
-
[280 /*
|
12903
|
-
[281 /*
|
12904
|
-
[282 /*
|
12905
|
-
[283 /*
|
12906
|
-
[284 /*
|
12907
|
-
[285 /*
|
12908
|
-
[286 /*
|
12909
|
-
[287 /*
|
12910
|
-
[288 /*
|
12911
|
-
[289 /*
|
12912
|
-
[290 /*
|
12913
|
-
[291 /*
|
12914
|
-
[292 /*
|
12915
|
-
[293 /*
|
12916
|
-
[294 /*
|
12917
|
-
[295 /*
|
12918
|
-
[296 /*
|
12919
|
-
[297 /*
|
12920
|
-
[298 /*
|
12921
|
-
[
|
12922
|
-
[
|
12923
|
-
[
|
12924
|
-
[303 /*
|
12925
|
-
[
|
12926
|
-
[
|
12927
|
-
[
|
12928
|
-
[
|
12929
|
-
[
|
12944
|
+
[279 /* OperatorFunction0MustNotHaveParameters */]: "Operator function '{0}' must not have parameters.",
|
12945
|
+
[280 /* OperatorFunction0MustHaveOneParameter */]: "Operator function '{0}' must have one parameter.",
|
12946
|
+
[281 /* OperatorFunction0MustHaveNoMoreThanOneParameter */]: "Operator function '{0}' must have no more than one parameter.",
|
12947
|
+
[282 /* CorrespondingBasicTypeMemberNotFound */]: "Corresponding basic type member not found.",
|
12948
|
+
[283 /* AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier */]: "Async function can only be called from function marked with 'async' modifier.",
|
12949
|
+
[284 /* TagNotFound */]: "Tag not found.",
|
12950
|
+
[285 /* TypeOrFunctionNameExpected */]: "Type or function name expected.",
|
12951
|
+
[286 /* PackageNameOrAliasExpected */]: "Package name or alias expected.",
|
12952
|
+
[287 /* ExpressionCanBeNone */]: "Expression can be none.",
|
12953
|
+
[288 /* TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator */]: "Target variable expression in the assignment statement cannot contain '?' operator used to check for 'none' value.",
|
12954
|
+
[289 /* UnreachableCode */]: "Unreachable code.",
|
12955
|
+
[290 /* RecursionOccurredWhileCalculatingTheTypeOfTheExpression */]: "Recursion occurred while calculating the type of the expression. To fix this error, specify the type of the variable explicitly.",
|
12956
|
+
[291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */]: "Recursion occurred while inferring the type of the variable. To fix this error, specify the type of the variable explicitly.",
|
12957
|
+
[292 /* ScopeAlreadyContainsDeclarationWithTheSameName */]: "Scope already contains declaration with the same name.",
|
12958
|
+
[293 /* ScopeAlreadyContainsFunctionWithTheSameNameAndParameterTypes */]: "Scope already contains function with the same name and parameter types.",
|
12959
|
+
[294 /* ParameterName0ConflictsWithAutomaticallyGeneratedVariableName */]: "Parameter name '{0}' conflicts with automatically generated variable name.",
|
12960
|
+
[295 /* PackageAlreadyContainsDeclarationWithTheSameName */]: "Package already contains declaration with the same name.",
|
12961
|
+
[296 /* PackageAlreadyContainsFunctionWithTheSameNameAndParameterTypes */]: "Package already contains function with the same name and parameter types.",
|
12962
|
+
[297 /* PackageAlreadyContainsTypeWithTheSameNameAndSameOrIntersectingTypeParameterCount */]: "Package already contains type with the same name and same or intersecting type parameter count.",
|
12963
|
+
[298 /* PackageAliasWithTheSameNameAlreadyExits */]: "Package alias with the same name already exits.",
|
12964
|
+
[300 /* PackageCanHaveOnlyOneConstructor */]: "Package can have only one constructor.",
|
12965
|
+
[301 /* TypeAlreadyContainsDeclarationWithTheSameName */]: "Type already contains declaration with the same name.",
|
12966
|
+
[302 /* TypeAlreadyContainsMethodWithTheSameNameAndParameterTypes */]: "Type already contains method with the same name and parameter types.",
|
12967
|
+
[303 /* TypeAlreadyContainsConstructorWithTheSameParameterTypes */]: "Type already contains constructor with the same parameter types.",
|
12968
|
+
[304 /* TypeAlreadyContainsOperatorFunctionWithTheSameParameterTypes */]: "Type already contains operator function with the same parameter types.",
|
12969
|
+
[305 /* TypeAlreadyContainsIndexerWithTheSameParameterTypes */]: "Type already contains indexer with the same parameter types.",
|
12970
|
+
[306 /* TypeCanHaveOnlyOneDestructor */]: "Type can have only one destructor.",
|
12971
|
+
[307 /* TypeCanHaveOnlyOneDereferenceOperator */]: "Type can have only one dereference operator.",
|
12972
|
+
[299 /* PackageCanHaveOnlyEntryPoint */]: "Package can have only entry point.",
|
12973
|
+
[308 /* VariableIsUsedBeforeItsDeclaration */]: "Variable is used before it's declaration.",
|
12974
|
+
[309 /* VariableMayNotHasBeenAssignedBeforeUsage */]: "Variable may not has been assigned before usage.",
|
12975
|
+
[310 /* NotAllCodePathsReturnAValueAndResultLocalVariableMayNotHasBeenAssigned */]: "Not all code paths return a value and 'result' local variable may not has been assigned.",
|
12976
|
+
[311 /* WriteFunctionHasNoCorrespondingReadFunction */]: "Write function has no corresponding read function.",
|
12977
|
+
[312 /* TypeCanNotHaveMultipleBaseObjectTypes */]: "Type can not have multiple base object types.",
|
12978
|
+
[313 /* TypeThatIsNotMarkedAsBasicCanNotBeUsedAsBaseType */]: "Type that is not marked as 'basic' can not be used as base type.",
|
12979
|
+
[314 /* PlainObjectTypeCanNotBeUsedAsBaseType */]: "Plain object type can not be used as base type.",
|
12980
|
+
[315 /* ThisTypeIsAlreadyListedInBaseTypeList */]: "This type is already listed in base type list.",
|
12981
|
+
[316 /* OnlyObjectAndAspectTypesCanBeUsedAsBaseTypes */]: "Only object and aspect types can be used as base types.",
|
12982
|
+
[317 /* PlainObjectTypeCanHaveOnlyAspectsAsBaseTypes */]: "Plain object type can have only aspects as base types.",
|
12983
|
+
[318 /* AspectTypeCanHaveOnlyAspectsAsBaseTypes */]: "Aspect type can have only aspects as base types.",
|
12984
|
+
[319 /* ModifierListAlreadyContains0Modifier */]: "Modifier list already contains '{0}' modifier.",
|
12985
|
+
[320 /* ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier */]: "Modifier list of outer declaration group already contains '{0}' modifier.",
|
12986
|
+
[321 /* _0ModifierIsNotAllowedHere */]: "'{0}' modifier is not allowed here.",
|
12987
|
+
[322 /* DeclarationCanNotBePlacedInGroupHaving0Modifier */]: "Declaration can not be placed in group having '{0}' modifier.",
|
12988
|
+
[323 /* PackageConstructorDeclarationCanNotHaveModifiers */]: "Package constructor declaration can not have own modifiers or be placed in group with modifiers.",
|
12989
|
+
[324 /* PackageEntryPointDeclarationCanNotHaveModifiers */]: "Package entry point declaration can not have own modifiers or be placed in group with modifiers.",
|
12990
|
+
[325 /* TranslationsCanNotHaveModifiers */]: "Translations can not have own modifiers or be placed in group with modifiers.",
|
12991
|
+
[326 /* AbstractModifierCanOnlyBeUsedInAbstractObjectTypes */]: "'abstract' modifier can only be used in abstract object types.",
|
12992
|
+
[327 /* BasicModifierCanOnlyBeUsedInObjectTypesAspectTypesAndTypeAliases */]: "'basic' modifier can only be used in object types, aspect types and type aliases.",
|
12993
|
+
[328 /* OverrideModifierCanOnlyBeUsedInObjectAndAspectTypes */]: "'override' modifier can only be used in object and aspect types.",
|
12994
|
+
[329 /* _0ModifierCanNotBeUsedWith1Modifier */]: "'{0}' modifier can not be used with '{1}' modifier.",
|
12995
|
+
[330 /* VariantDeclarationCanNotHaveHiddenModifier */]: "Variant declaration can 'not' have hidden modifier.",
|
12996
|
+
[331 /* BasicModifierCanOnlyBeAppliedToObjectTypes */]: "'basic' modifier can only be applied to object types.",
|
12997
|
+
[332 /* AbstractModifierCanOnlyBeAppliedToObjectTypes */]: "'abstract' modifier can only be applied to object types.",
|
12998
|
+
[333 /* NotBasicObjectTypesCanNotHaveBasicMembers */]: "Not 'basic' object types can not have 'basic' members",
|
12999
|
+
[334 /* WriteFunctionMustHaveTheSameModifiersAsReadFunction */]: "Write function must have the same modifiers as read function.",
|
13000
|
+
[335 /* WriteFunctionMustHaveTheSameOrMoreRestrictiveHidingLevelThenReadFunction */]: "Write function must have the same or more restrictive hiding level then read function.",
|
12930
13001
|
[401 /* CannotFindTsLibDirectoryBaseSearchPaths0 */]: "Can not find directory with TypeScript library. Base search paths: {0}.",
|
12931
13002
|
[402 /* SourceFile0IsNotPartOfThePackageAndWontBeLoaded */]: "Source file '{0}' is not part of the package and won't be loaded.",
|
12932
13003
|
[403 /* ProgramWithoutMainPackageCannotBeCompiled */]: "Program without main package can not be compiled.",
|
@@ -13049,36 +13120,64 @@ var russianErrorMessages = {
|
|
13049
13120
|
[276 /* IncorrectBodyOfBasicAliasTypeMethod */]: "\u0422\u0435\u043B\u043E \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u043E\u0433\u043E \u043C\u0435\u0442\u043E\u0434\u0430, \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0432 \u0442\u043E\u0436\u0434\u0435\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u043C \u0442\u0438\u043F\u0435, \u0434\u043E\u043B\u0436\u043D\u043E \u0441\u043E\u0441\u0442\u043E\u044F\u0442\u044C \u0438\u0437 \u0432\u044B\u0437\u043E\u0432\u0430 \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u043C\u0435\u0442\u043E\u0434\u0430 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430 \u0441 \u0442\u0430\u043A\u0438\u043C\u0438 \u0436\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438 \u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u044B\u043C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435\u043C.",
|
13050
13121
|
[277 /* TheFollowingDeclarationsAreNotTranslated0 */]: "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043D\u044B: {0}.",
|
13051
13122
|
[278 /* TheFollowingDeclarationAreNotTranslated0And1More */]: "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043D\u044B: {0} \u0438 \u0435\u0449\u0451 {1}.",
|
13052
|
-
[279 /*
|
13053
|
-
[280 /*
|
13054
|
-
[281 /*
|
13055
|
-
[282 /*
|
13056
|
-
[283 /*
|
13057
|
-
[
|
13058
|
-
[
|
13059
|
-
[
|
13060
|
-
[
|
13061
|
-
[287 /*
|
13062
|
-
[288 /*
|
13063
|
-
[289 /*
|
13064
|
-
[290 /*
|
13065
|
-
[291 /*
|
13066
|
-
[292 /*
|
13067
|
-
[293 /*
|
13068
|
-
[294 /*
|
13069
|
-
[295 /*
|
13070
|
-
[296 /*
|
13071
|
-
[297 /*
|
13072
|
-
[298 /*
|
13073
|
-
[
|
13074
|
-
[
|
13075
|
-
[301 /*
|
13076
|
-
[
|
13077
|
-
[
|
13078
|
-
[304 /*
|
13079
|
-
[305 /*
|
13080
|
-
[306 /*
|
13081
|
-
[307 /*
|
13123
|
+
[279 /* OperatorFunction0MustNotHaveParameters */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 '{0}' \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13124
|
+
[280 /* OperatorFunction0MustHaveOneParameter */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 '{0}' \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u043E\u0434\u0438\u043D \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440.",
|
13125
|
+
[281 /* OperatorFunction0MustHaveNoMoreThanOneParameter */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 '{0}' \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u043D\u0435 \u0431\u043E\u043B\u0435\u0435 \u043E\u0434\u043D\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430.",
|
13126
|
+
[282 /* CorrespondingBasicTypeMemberNotFound */]: "\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u0437\u043E\u0432\u044B\u0439 \u0447\u043B\u0435\u043D \u0442\u0438\u043F\u0430.",
|
13127
|
+
[283 /* AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier */]: "\u0410\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u0430\u044F \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0432\u044B\u0437\u0432\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u0437 \u0444\u0443\u043D\u043A\u0446\u0438\u0438, \u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u043E\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C '\u0430\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u043E'.",
|
13128
|
+
[130 /* TagNameExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0442\u0435\u0433\u0430.",
|
13129
|
+
[284 /* TagNotFound */]: "\u0422\u0435\u0433 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.",
|
13130
|
+
[285 /* TypeOrFunctionNameExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0442\u0438\u043F\u0430 \u0438\u043B\u0438 \u0444\u0443\u043D\u043A\u0446\u0438\u0438.",
|
13131
|
+
[286 /* PackageNameOrAliasExpected */]: "\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0438\u043C\u044F \u0438\u043B\u0438 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u043F\u0430\u043A\u0435\u0442\u0430.",
|
13132
|
+
[287 /* ExpressionCanBeNone */]: "\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043C\u043E\u0436\u0435\u0442 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 '\u043F\u0443\u0441\u0442\u043E'.",
|
13133
|
+
[288 /* TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator */]: "\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0446\u0435\u043B\u0435\u0432\u043E\u0439 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0432 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 \u043F\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0437\u043D\u0430\u043A \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 '?' \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043D\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 '\u043F\u0443\u0441\u0442\u043E'.",
|
13134
|
+
[289 /* UnreachableCode */]: "\u041D\u0435\u0434\u043E\u0441\u0442\u0438\u0436\u0438\u043C\u044B\u0439 \u043A\u043E\u0434.",
|
13135
|
+
[290 /* RecursionOccurredWhileCalculatingTheTypeOfTheExpression */]: "\u041F\u0440\u0438 \u0432\u044B\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u0438 \u0442\u0438\u043F\u0430 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u0440\u0435\u043A\u0443\u0440\u0441\u0438\u044F. \u0427\u0442\u043E\u0431\u044B \u0438\u0441\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u044D\u0442\u0443 \u043E\u0448\u0438\u0431\u043A\u0443, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u044F\u0432\u043D\u043E\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u0438\u0435 \u0442\u0438\u043F\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439.",
|
13136
|
+
[291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */]: "\u041F\u0440\u0438 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0438 \u0442\u0438\u043F\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u0440\u0435\u043A\u0443\u0440\u0441\u0438\u044F. \u0427\u0442\u043E\u0431\u044B \u0438\u0441\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u044D\u0442\u0443 \u043E\u0448\u0438\u0431\u043A\u0443, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u044F\u0432\u043D\u043E\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u0438\u0435 \u0442\u0438\u043F\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439.",
|
13137
|
+
[292 /* ScopeAlreadyContainsDeclarationWithTheSameName */]: "\u041E\u0431\u043B\u0430\u0441\u0442\u044C \u0432\u0438\u0434\u0438\u043C\u043E\u0441\u0442\u0438 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C.",
|
13138
|
+
[293 /* ScopeAlreadyContainsFunctionWithTheSameNameAndParameterTypes */]: "\u041E\u0431\u043B\u0430\u0441\u0442\u044C \u0432\u0438\u0434\u0438\u043C\u043E\u0441\u0442\u0438 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C \u0438 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13139
|
+
[294 /* ParameterName0ConflictsWithAutomaticallyGeneratedVariableName */]: "\u0418\u043C\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 '{0}' \u043A\u043E\u043D\u0444\u043B\u0438\u043A\u0442\u0443\u0435\u0442 \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u043E\u0439 \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0442\u043E\u0440\u043E\u043C \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.",
|
13140
|
+
[295 /* PackageAlreadyContainsDeclarationWithTheSameName */]: "\u041F\u0430\u043A\u0435\u0442 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C.",
|
13141
|
+
[296 /* PackageAlreadyContainsFunctionWithTheSameNameAndParameterTypes */]: "\u041F\u0430\u043A\u0435\u0442 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C \u0438 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13142
|
+
[297 /* PackageAlreadyContainsTypeWithTheSameNameAndSameOrIntersectingTypeParameterCount */]: "\u041F\u0430\u043A\u0435\u0442 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0438\u043F \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C \u0438 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u044E\u0449\u0438\u043C\u0441\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u043C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0442\u0438\u043F\u0430.",
|
13143
|
+
[298 /* PackageAliasWithTheSameNameAlreadyExits */]: "\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u043F\u0430\u043A\u0435\u0442\u0430 \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.",
|
13144
|
+
[300 /* PackageCanHaveOnlyOneConstructor */]: "\u041F\u0430\u043A\u0435\u0442 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440.",
|
13145
|
+
[299 /* PackageCanHaveOnlyEntryPoint */]: "\u041F\u0430\u043A\u0435\u0442 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0431\u043B\u043E\u043A '\u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C'.",
|
13146
|
+
[301 /* TypeAlreadyContainsDeclarationWithTheSameName */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C.",
|
13147
|
+
[302 /* TypeAlreadyContainsMethodWithTheSameNameAndParameterTypes */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043C\u0435\u0442\u043E\u0434 \u0441 \u0442\u0430\u043A\u0438\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C \u0438 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13148
|
+
[303 /* TypeAlreadyContainsConstructorWithTheSameParameterTypes */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440 \u0441 \u0442\u0430\u043A\u0438\u043C\u0438 \u0436\u0435 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13149
|
+
[304 /* TypeAlreadyContainsOperatorFunctionWithTheSameParameterTypes */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0442\u0430\u043A\u0438\u043C\u0438 \u0436\u0435 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13150
|
+
[305 /* TypeAlreadyContainsIndexerWithTheSameParameterTypes */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043D\u0434\u0435\u043A\u0441\u0430\u0442\u043E\u0440 \u0441 \u0442\u0430\u043A\u0438\u043C\u0438 \u0436\u0435 \u0442\u0438\u043F\u0430\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
|
13151
|
+
[306 /* TypeCanHaveOnlyOneDestructor */]: "\u0422\u0438\u043F \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0434\u0435\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440.",
|
13152
|
+
[307 /* TypeCanHaveOnlyOneDereferenceOperator */]: "\u0422\u0438\u043F \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0440\u0430\u0437\u044B\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C.",
|
13153
|
+
[308 /* VariableIsUsedBeforeItsDeclaration */]: "\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u0434\u043E \u0435\u0451 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u044F.",
|
13154
|
+
[309 /* VariableMayNotHasBeenAssignedBeforeUsage */]: "\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043C\u043E\u0433\u043B\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u0440\u0438\u0441\u0432\u043E\u0435\u043D\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F.",
|
13155
|
+
[310 /* NotAllCodePathsReturnAValueAndResultLocalVariableMayNotHasBeenAssigned */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u043E \u0432\u0441\u0435\u0445 \u0441\u043B\u0443\u0447\u0430\u044F\u0445 \u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 '\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442' \u043C\u043E\u0433\u043B\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u0440\u0438\u0441\u0432\u043E\u0435\u043D\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435.",
|
13156
|
+
[311 /* WriteFunctionHasNoCorrespondingReadFunction */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u0437\u0430\u043F\u0438\u0441\u0438 \u043D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0435\u0439 \u0444\u0443\u043D\u043A\u0446\u0438\u0438 \u0447\u0442\u0435\u043D\u0438\u044F.",
|
13157
|
+
[312 /* TypeCanNotHaveMultipleBaseObjectTypes */]: "\u0422\u0438\u043F \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0431\u0430\u0437\u043E\u0432\u044B\u0445 \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u0445 \u0442\u0438\u043F\u043E\u0432.",
|
13158
|
+
[313 /* TypeThatIsNotMarkedAsBasicCanNotBeUsedAsBaseType */]: "\u0422\u0438\u043F, \u043D\u0435 \u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C '\u0431\u0430\u0437\u043E\u0432\u044B\u0439', \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u0442\u0438\u043F\u0430.",
|
13159
|
+
[314 /* PlainObjectTypeCanNotBeUsedAsBaseType */]: "\u041F\u0440\u043E\u0441\u0442\u043E\u0439 \u043E\u0431\u044A\u0435\u043A\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u0442\u0438\u043F\u0430.",
|
13160
|
+
[315 /* ThisTypeIsAlreadyListedInBaseTypeList */]: "\u0422\u0438\u043F \u0443\u0436\u0435 \u0443\u043A\u0430\u0437\u0430\u043D \u0432 \u0441\u043F\u0438\u0441\u043A\u0435 \u0431\u0430\u0437\u043E\u0432\u044B\u0445 \u0442\u0438\u043F\u043E\u0432.",
|
13161
|
+
[316 /* OnlyObjectAndAspectTypesCanBeUsedAsBaseTypes */]: "\u0422\u043E\u043B\u044C\u043A\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u0435 \u0438 \u0430\u0441\u043F\u0435\u043A\u0442\u043D\u044B\u0435 \u0442\u0438\u043F\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u044B \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u044B\u0445.",
|
13162
|
+
[317 /* PlainObjectTypeCanHaveOnlyAspectsAsBaseTypes */]: "\u0412 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u044B\u0445 \u0442\u0438\u043F\u043E\u0432 \u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u0430\u0441\u043F\u0435\u043A\u0442\u044B.",
|
13163
|
+
[318 /* AspectTypeCanHaveOnlyAspectsAsBaseTypes */]: "\u0412 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u044B\u0445 \u0442\u0438\u043F\u043E\u0432 \u0430\u0441\u043F\u0435\u043A\u0442\u0430 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0441\u043F\u0435\u043A\u0442\u044B.",
|
13164
|
+
[319 /* ModifierListAlreadyContains0Modifier */]: "\u0421\u043F\u0438\u0441\u043E\u043A \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '{0}'.",
|
13165
|
+
[320 /* ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier */]: "\u0421\u043F\u0438\u0441\u043E\u043A \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432 \u0432\u043D\u0435\u0448\u043D\u0435\u0439 \u0433\u0440\u0443\u043F\u043F\u044B \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0439 \u0443\u0436\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '{0}'.",
|
13166
|
+
[321 /* _0ModifierIsNotAllowedHere */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '{0}' \u0437\u0434\u0435\u0441\u044C \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C.",
|
13167
|
+
[322 /* DeclarationCanNotBePlacedInGroupHaving0Modifier */]: "\u041E\u0431\u044A\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0440\u0430\u0441\u043F\u043E\u043B\u0430\u0433\u0430\u0442\u044C\u0441\u044F \u0432 \u0433\u0440\u0443\u043F\u043F\u0435, \u0438\u043C\u0435\u044E\u0449\u0435\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '{0}'.",
|
13168
|
+
[323 /* PackageConstructorDeclarationCanNotHaveModifiers */]: "\u041A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440 \u043F\u0430\u043A\u0435\u0442\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432 \u0438\u043B\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u0430\u0433\u0430\u0442\u044C\u0441\u044F \u0432 \u0433\u0440\u0443\u043F\u043F\u0435, \u0438\u043C\u0435\u044E\u0449\u0435\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B.",
|
13169
|
+
[324 /* PackageEntryPointDeclarationCanNotHaveModifiers */]: "\u0411\u043B\u043E\u043A '\u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C' \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432 \u0438\u043B\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u0430\u0433\u0430\u0442\u044C\u0441\u044F \u0432 \u0433\u0440\u0443\u043F\u043F\u0435, \u0438\u043C\u0435\u044E\u0449\u0435\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B.",
|
13170
|
+
[325 /* TranslationsCanNotHaveModifiers */]: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0438\u043C\u0435\u0442\u044C \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432 \u0438\u043B\u0438 \u0440\u0430\u0441\u043F\u043E\u043B\u0430\u0433\u0430\u0442\u044C\u0441\u044F \u0432 \u0433\u0440\u0443\u043F\u043F\u0435, \u0438\u043C\u0435\u044E\u0449\u0435\u0439 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B.",
|
13171
|
+
[326 /* AbstractModifierCanOnlyBeUsedInAbstractObjectTypes */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0430\u0431\u0441\u0442\u0440\u0430\u043A\u0442\u043D\u0430\u044F' \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043A\u0442\u043D\u044B\u0445 \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u0445 \u0442\u0438\u043F\u0430\u0445.",
|
13172
|
+
[327 /* BasicModifierCanOnlyBeUsedInObjectTypesAspectTypesAndTypeAliases */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0431\u0430\u0437\u043E\u0432\u0430\u044F' \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u0445 \u0442\u0438\u043F\u0430\u0445, \u0430\u0441\u043F\u0435\u043A\u0442\u043D\u044B\u0445 \u0442\u0438\u043F\u0430\u0445 \u0438 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u0430\u0445 \u0442\u0438\u043F\u0430.",
|
13173
|
+
[328 /* OverrideModifierCanOnlyBeUsedInObjectAndAspectTypes */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u0430\u044F' \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u0445 \u0438 \u0430\u0441\u043F\u0435\u043A\u0442\u043D\u044B\u0445 \u0442\u0438\u043F\u0430\u0445.",
|
13174
|
+
[329 /* _0ModifierCanNotBeUsedWith1Modifier */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '{0}' \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u043D\u043E \u0441 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C '{1}'.",
|
13175
|
+
[330 /* VariantDeclarationCanNotHaveHiddenModifier */]: "\u0412\u0430\u0440\u0438\u0430\u043D\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u043C\u0435\u0442\u044C \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0441\u043A\u0440\u044B\u0442\u043E'.",
|
13176
|
+
[331 /* BasicModifierCanOnlyBeAppliedToObjectTypes */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0431\u0430\u0437\u043E\u0432\u044B\u0439' \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043A \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u043C \u0442\u0438\u043F\u0430\u043C.",
|
13177
|
+
[332 /* AbstractModifierCanOnlyBeAppliedToObjectTypes */]: "\u041C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 '\u0430\u0431\u0441\u0442\u0440\u0430\u043A\u0442\u043D\u044B\u0439' \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043A \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u044B\u043C \u0442\u0438\u043F\u0430\u043C.",
|
13178
|
+
[333 /* NotBasicObjectTypesCanNotHaveBasicMembers */]: "\u0427\u043B\u0435\u043D\u044B \u043E\u0431\u044A\u0435\u043A\u0442\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430, \u043D\u0435 \u043F\u043E\u043C\u0435\u0447\u0435\u043D\u043D\u043E\u0433\u043E \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u043C '\u0431\u0430\u0437\u043E\u0432\u044B\u0439', \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0431\u0430\u0437\u043E\u0432\u044B\u043C\u0438.",
|
13179
|
+
[334 /* WriteFunctionMustHaveTheSameModifiersAsReadFunction */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u0437\u0430\u043F\u0438\u0441\u0438 \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u0442\u0430\u043A\u0438\u0435 \u0436\u0435 \u043C\u043E\u0434\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B, \u043A\u0430\u043A \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u0447\u0442\u0435\u043D\u0438\u044F.",
|
13180
|
+
[335 /* WriteFunctionMustHaveTheSameOrMoreRestrictiveHidingLevelThenReadFunction */]: "\u0424\u0443\u043D\u043A\u0446\u0438\u044F \u0437\u0430\u043F\u0438\u0441\u0438 \u0434\u043E\u043B\u0436\u043D\u0430 \u0438\u043C\u0435\u0442\u044C \u0442\u0430\u043A\u043E\u0439 \u0436\u0435 \u0438\u043B\u0438 \u0431\u043E\u043B\u0435\u0435 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0432\u0430\u044E\u0449\u0438\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0441\u043A\u0440\u044B\u0442\u043D\u043E\u0441\u0442\u0438, \u0447\u0435\u043C \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u0447\u0442\u0435\u043D\u0438\u044F.",
|
13082
13181
|
[401 /* CannotFindTsLibDirectoryBaseSearchPaths0 */]: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043D\u0430\u0439\u0442\u0438 \u043F\u0430\u043F\u043A\u0443 \u0441\u043E \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u0439 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u043E\u0439 TypeScript. \u041F\u0443\u0442\u0438, \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u043E\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043B\u044F\u043B\u0441\u044F \u043F\u043E\u0438\u0441\u043A: {0}.",
|
13083
13182
|
[402 /* SourceFile0IsNotPartOfThePackageAndWontBeLoaded */]: "\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0444\u0430\u0439\u043B '{0}' \u043D\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0447\u0430\u0441\u0442\u044C\u044E \u043F\u0430\u043A\u0435\u0442\u0430 \u0438 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D.",
|
13084
13183
|
[403 /* ProgramWithoutMainPackageCannotBeCompiled */]: "\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0431\u0435\u0437 \u0433\u043B\u0430\u0432\u043D\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u0430.",
|
@@ -16684,7 +16783,7 @@ var TranslationPackage = class extends SourcePackageBase {
|
|
16684
16783
|
}
|
16685
16784
|
};
|
16686
16785
|
var TranslationPackageConfiguration = class {
|
16687
|
-
constructor(targetPackageName, translatedName, translationLocale, locale, dialect) {
|
16786
|
+
constructor(targetPackageName, translatedName, translationLocale, locale, dialect = DefaultDialect) {
|
16688
16787
|
this.targetPackageName = targetPackageName;
|
16689
16788
|
this.translatedName = translatedName;
|
16690
16789
|
this.translationLocale = translationLocale;
|
@@ -16696,7 +16795,7 @@ var TranslationPackageConfiguration = class {
|
|
16696
16795
|
}
|
16697
16796
|
};
|
16698
16797
|
var ProgramPackageConfiguration = class {
|
16699
|
-
constructor(name, locale, dialect, version, targetPlatform = new TargetPlatformConfig.Any(), requiredPackages = [], implementedInterfacePackageName, jsProjectRootUri, packageImportLocales = [], automaticallyImportedPackages) {
|
16798
|
+
constructor(name, locale, dialect = DefaultDialect, version, targetPlatform = new TargetPlatformConfig.Any(), requiredPackages = [], implementedInterfacePackageName, jsProjectRootUri, packageImportLocales = [], automaticallyImportedPackages) {
|
16700
16799
|
this.name = name;
|
16701
16800
|
this.locale = locale;
|
16702
16801
|
this.dialect = dialect;
|
@@ -20167,16 +20266,16 @@ var ExpressionParser = class {
|
|
20167
20266
|
}
|
20168
20267
|
case 26 /* Dot */: {
|
20169
20268
|
const dotToken = this.parser.parseExpectedToken(26 /* Dot */);
|
20170
|
-
let
|
20269
|
+
let memberName;
|
20171
20270
|
const runKeyword = this.parser.parseOptionalKeyword(7 /* Run */);
|
20172
20271
|
if (runKeyword !== void 0) {
|
20173
20272
|
Debug.assert(runKeyword.tokens.length === 1);
|
20174
|
-
|
20273
|
+
memberName = runKeyword.tokens[0];
|
20175
20274
|
} else {
|
20176
|
-
|
20275
|
+
memberName = this.parser.parseIdentifier();
|
20177
20276
|
}
|
20178
20277
|
expression = this.parser.intern(
|
20179
|
-
new MemberAccessExpression2(expression, dotToken,
|
20278
|
+
new MemberAccessExpression2(expression, dotToken, memberName),
|
20180
20279
|
expressionStart
|
20181
20280
|
);
|
20182
20281
|
break;
|
@@ -23656,6 +23755,12 @@ var StructuredType2 = class {
|
|
23656
23755
|
isPlainObject() {
|
23657
23756
|
return this._entity.isPlainObject();
|
23658
23757
|
}
|
23758
|
+
markedBasic() {
|
23759
|
+
return this._entity.markedBasic();
|
23760
|
+
}
|
23761
|
+
isAbstract() {
|
23762
|
+
return this._entity.isAbstract();
|
23763
|
+
}
|
23659
23764
|
equals(other) {
|
23660
23765
|
return this === other || other.kind === "structured" && this._entity === other.getEntity() && this._substitutions.equals(other.getSubstitutions());
|
23661
23766
|
}
|
@@ -26043,8 +26148,8 @@ var TsGlobalClassOrInterfaceEntity = class {
|
|
26043
26148
|
getDefinition() {
|
26044
26149
|
return { kind: 2 /* TypeScript */ };
|
26045
26150
|
}
|
26046
|
-
|
26047
|
-
return
|
26151
|
+
markedBasic() {
|
26152
|
+
return this.isRefObject();
|
26048
26153
|
}
|
26049
26154
|
isAbstract() {
|
26050
26155
|
const decl = this.getDeclaration();
|
@@ -26170,8 +26275,8 @@ var SourceAndTsGlobalClassOrInterfaceMergeEntity = class {
|
|
26170
26275
|
getDefinition() {
|
26171
26276
|
return this._sourceData.getDefinition();
|
26172
26277
|
}
|
26173
|
-
|
26174
|
-
return this._sourceData.
|
26278
|
+
markedBasic() {
|
26279
|
+
return this._sourceData.markedBasic();
|
26175
26280
|
}
|
26176
26281
|
isAbstract() {
|
26177
26282
|
return this._sourceData.isAbstract();
|
@@ -26243,7 +26348,7 @@ var TsTypeLiteralEntity = class {
|
|
26243
26348
|
getDefinition() {
|
26244
26349
|
return { kind: 2 /* TypeScript */ };
|
26245
26350
|
}
|
26246
|
-
|
26351
|
+
markedBasic() {
|
26247
26352
|
return false;
|
26248
26353
|
}
|
26249
26354
|
isAbstract() {
|
@@ -26335,8 +26440,8 @@ var TsNamedTypeLiteralEntity = class {
|
|
26335
26440
|
getDefinition() {
|
26336
26441
|
return { kind: 2 /* TypeScript */ };
|
26337
26442
|
}
|
26338
|
-
|
26339
|
-
return
|
26443
|
+
markedBasic() {
|
26444
|
+
return false;
|
26340
26445
|
}
|
26341
26446
|
isAbstract() {
|
26342
26447
|
return false;
|
@@ -26419,8 +26524,8 @@ var SourceAndTsNamedTypeLiteralMergeEntity = class {
|
|
26419
26524
|
getDefinition() {
|
26420
26525
|
return this._sourceData.getDefinition();
|
26421
26526
|
}
|
26422
|
-
|
26423
|
-
return this._sourceData.
|
26527
|
+
markedBasic() {
|
26528
|
+
return this._sourceData.markedBasic();
|
26424
26529
|
}
|
26425
26530
|
isAbstract() {
|
26426
26531
|
return this._sourceData.isAbstract();
|
@@ -27576,6 +27681,888 @@ import ts4 from "typescript";
|
|
27576
27681
|
// source/ts-interop/TsPackageMembersCreator.ts
|
27577
27682
|
import ts3 from "typescript";
|
27578
27683
|
|
27684
|
+
// source/analysis/FindModifier.ts
|
27685
|
+
function findModifier(node, modifierKeywordKind) {
|
27686
|
+
for (const modifier of node.modifierList.modifiers) {
|
27687
|
+
if (modifier.value.keywordKind === modifierKeywordKind) {
|
27688
|
+
return modifier;
|
27689
|
+
}
|
27690
|
+
}
|
27691
|
+
if (node.parent.kind === 2 /* PackageMemberDeclarationList */) {
|
27692
|
+
let parent = node.parent.parent;
|
27693
|
+
while (parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
27694
|
+
for (const modifier of parent.modifierList.modifiers) {
|
27695
|
+
if (modifier.value.keywordKind === modifierKeywordKind) {
|
27696
|
+
return modifier;
|
27697
|
+
}
|
27698
|
+
}
|
27699
|
+
parent = parent.parent.parent;
|
27700
|
+
}
|
27701
|
+
} else if (node.parent.kind === 31 /* TypeMemberDeclarationList */) {
|
27702
|
+
let parent = node.parent.parent.parent;
|
27703
|
+
while (parent.kind === 44 /* TypeMemberGroupDeclaration */) {
|
27704
|
+
for (const modifier of parent.modifierList.modifiers) {
|
27705
|
+
if (modifier.value.keywordKind === modifierKeywordKind) {
|
27706
|
+
return modifier;
|
27707
|
+
}
|
27708
|
+
}
|
27709
|
+
parent = parent.parent.parent.parent;
|
27710
|
+
}
|
27711
|
+
} else {
|
27712
|
+
Debug.never(node.parent);
|
27713
|
+
}
|
27714
|
+
return void 0;
|
27715
|
+
}
|
27716
|
+
function createDeclaredModifierFlags(node) {
|
27717
|
+
let result = 0 /* None */;
|
27718
|
+
for (const modifier of node.modifierList.modifiers) {
|
27719
|
+
result |= modifierToModifierFlag(modifier);
|
27720
|
+
}
|
27721
|
+
if (node.parent.kind === 2 /* PackageMemberDeclarationList */) {
|
27722
|
+
let parent = node.parent.parent;
|
27723
|
+
while (parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
27724
|
+
for (const modifier of parent.modifierList.modifiers) {
|
27725
|
+
result |= modifierToModifierFlag(modifier);
|
27726
|
+
}
|
27727
|
+
parent = parent.parent.parent;
|
27728
|
+
}
|
27729
|
+
} else if (node.parent.kind === 31 /* TypeMemberDeclarationList */) {
|
27730
|
+
let parent = node.parent.parent.parent;
|
27731
|
+
while (parent.kind === 44 /* TypeMemberGroupDeclaration */) {
|
27732
|
+
for (const modifier of parent.modifierList.modifiers) {
|
27733
|
+
result |= modifierToModifierFlag(modifier);
|
27734
|
+
}
|
27735
|
+
parent = parent.parent.parent.parent;
|
27736
|
+
}
|
27737
|
+
} else {
|
27738
|
+
Debug.never(node.parent);
|
27739
|
+
}
|
27740
|
+
return result;
|
27741
|
+
}
|
27742
|
+
function modifierToModifierFlag(modifier) {
|
27743
|
+
switch (modifier.value.keywordKind) {
|
27744
|
+
case 37 /* Hidden */:
|
27745
|
+
switch (modifier.level?.keywordKind) {
|
27746
|
+
case void 0:
|
27747
|
+
return 1 /* HiddenWithoutLevel */;
|
27748
|
+
case 48 /* InHierarchy */:
|
27749
|
+
return 4 /* HiddenInHierarchy */;
|
27750
|
+
case 49 /* InFile */:
|
27751
|
+
return 8 /* HiddenInFile */;
|
27752
|
+
case 50 /* InPackage */:
|
27753
|
+
return 16 /* HiddenInPackage */;
|
27754
|
+
case 51 /* InType */:
|
27755
|
+
return 2 /* HiddenInType */;
|
27756
|
+
default:
|
27757
|
+
Debug.never(modifier.level);
|
27758
|
+
}
|
27759
|
+
case 17 /* Basic */:
|
27760
|
+
return 32 /* Basic */;
|
27761
|
+
case 36 /* Const */:
|
27762
|
+
return 1024 /* Const */;
|
27763
|
+
case 38 /* Abstract */:
|
27764
|
+
return 128 /* Abstract */;
|
27765
|
+
case 39 /* Override */:
|
27766
|
+
return 256 /* Override */;
|
27767
|
+
case 40 /* Async */:
|
27768
|
+
return 512 /* Async */;
|
27769
|
+
case 41 /* Static */:
|
27770
|
+
return 64 /* Static */;
|
27771
|
+
default:
|
27772
|
+
Debug.never(modifier.value.keywordKind);
|
27773
|
+
}
|
27774
|
+
}
|
27775
|
+
|
27776
|
+
// source/analysis/ModifierValidator.ts
|
27777
|
+
var ModifierValidator = class _ModifierValidator {
|
27778
|
+
constructor(_analyzer, _diagnostics, _locale, _dialect) {
|
27779
|
+
this._analyzer = _analyzer;
|
27780
|
+
this._diagnostics = _diagnostics;
|
27781
|
+
this._locale = _locale;
|
27782
|
+
this._dialect = _dialect;
|
27783
|
+
}
|
27784
|
+
static {
|
27785
|
+
this.allowedPackageMemberHidingModifiers = 17 /* HiddenInPackageOrWithoutLevel */ | 8 /* HiddenInFile */;
|
27786
|
+
}
|
27787
|
+
static {
|
27788
|
+
this.allowedPackageMemberModifiers = this.allowedPackageMemberHidingModifiers | 32 /* Basic */ | 128 /* Abstract */ | 512 /* Async */ | 1024 /* Const */;
|
27789
|
+
}
|
27790
|
+
static {
|
27791
|
+
this.allowedModifiersByPackageMemberDeclarationKind = {
|
27792
|
+
[0 /* TranslationsDeclaration */]: 0 /* None */,
|
27793
|
+
[1 /* AliasTypeDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27794
|
+
[2 /* MemberGroupDeclaration */]: this.allowedPackageMemberModifiers,
|
27795
|
+
[3 /* TypeExtensionDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27796
|
+
[4 /* ConstructorDeclaration */]: 0 /* None */,
|
27797
|
+
[5 /* EntryPointDeclaration */]: 0 /* None */,
|
27798
|
+
[6 /* FunctionDeclaration */]: this.allowedPackageMemberHidingModifiers | 512 /* Async */,
|
27799
|
+
[7 /* FunctionTypeDeclaration */]: this.allowedPackageMemberHidingModifiers | 512 /* Async */,
|
27800
|
+
[8 /* ObjectTypeDeclaration */]: this.allowedPackageMemberHidingModifiers | 32 /* Basic */ | 128 /* Abstract */,
|
27801
|
+
[9 /* PlainObjectTypeDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27802
|
+
[10 /* AspectTypeDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27803
|
+
[11 /* VariableDeclaration */]: this.allowedPackageMemberHidingModifiers | 1024 /* Const */,
|
27804
|
+
[12 /* VariableGetterDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27805
|
+
[13 /* VariableSetterDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27806
|
+
[14 /* VariantTypeDeclaration */]: this.allowedPackageMemberHidingModifiers,
|
27807
|
+
[15 /* InvalidDeclaration */]: this.allowedPackageMemberModifiers
|
27808
|
+
};
|
27809
|
+
}
|
27810
|
+
static {
|
27811
|
+
this.allowedTypeMemberHidingModifiers = 16 /* HiddenInPackage */ | 8 /* HiddenInFile */ | 4 /* HiddenInHierarchy */ | 3 /* HiddenInTypeOrWithoutLevel */;
|
27812
|
+
}
|
27813
|
+
static {
|
27814
|
+
this.allowedTypeMemberModifiers = this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */ | 512 /* Async */ | 1024 /* Const */;
|
27815
|
+
}
|
27816
|
+
static {
|
27817
|
+
this.allowedModifiersByTypeMemberDeclarationKind = {
|
27818
|
+
[44 /* TypeMemberGroupDeclaration */]: this.allowedTypeMemberModifiers,
|
27819
|
+
[45 /* ConstructorDeclaration */]: this.allowedTypeMemberHidingModifiers,
|
27820
|
+
[46 /* DestructorDeclaration */]: this.allowedTypeMemberHidingModifiers,
|
27821
|
+
[47 /* IndexedElementGetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27822
|
+
[48 /* IndexedElementSetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27823
|
+
[50 /* DereferencedVariableGetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27824
|
+
[51 /* DereferencedVariableSetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27825
|
+
[52 /* MethodDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */ | 512 /* Async */,
|
27826
|
+
[53 /* OperatorDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 128 /* Abstract */ | 256 /* Override */,
|
27827
|
+
[54 /* FieldDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */ | 1024 /* Const */,
|
27828
|
+
[55 /* FieldGetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27829
|
+
[56 /* FieldSetterDeclaration */]: this.allowedTypeMemberHidingModifiers | 32 /* Basic */ | 64 /* Static */ | 128 /* Abstract */ | 256 /* Override */,
|
27830
|
+
[57 /* InvalidTypeMemberDeclaration */]: this.allowedTypeMemberModifiers,
|
27831
|
+
[142 /* VariantDeclaration */]: 0 /* None */
|
27832
|
+
};
|
27833
|
+
}
|
27834
|
+
static validatePackageVariableAccessorsHaveConsistentModifiers(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27835
|
+
const allowedGetterModifiers = getterModifiers & this.allowedModifiersByPackageMemberDeclarationKind[12 /* VariableGetterDeclaration */];
|
27836
|
+
const allowedSetterModifiers = setterModifiers & this.allowedModifiersByPackageMemberDeclarationKind[13 /* VariableSetterDeclaration */];
|
27837
|
+
if (this.validatePackageMemberSetterHasMoreRestrictiveHidingLevel(
|
27838
|
+
analyzer,
|
27839
|
+
allowedGetterModifiers,
|
27840
|
+
allowedSetterModifiers,
|
27841
|
+
nodeForDiagnostic,
|
27842
|
+
diagnostics
|
27843
|
+
)) {
|
27844
|
+
const getterModifiersWithoutHiding = allowedGetterModifiers & ~31 /* AnyHiddenModifier */;
|
27845
|
+
const setterModifiersWithoutHiding = allowedSetterModifiers & ~31 /* AnyHiddenModifier */;
|
27846
|
+
if (getterModifiersWithoutHiding !== setterModifiersWithoutHiding) {
|
27847
|
+
this.reportSetterMustHaveSameModifiersAsGetter(analyzer, nodeForDiagnostic, diagnostics);
|
27848
|
+
}
|
27849
|
+
}
|
27850
|
+
}
|
27851
|
+
static validateFieldAccessorsHaveConsistentModifiers(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27852
|
+
this.validateTypeMemberAccessorsHaveConsistentModifiers(
|
27853
|
+
analyzer,
|
27854
|
+
getterModifiers,
|
27855
|
+
setterModifiers,
|
27856
|
+
nodeForDiagnostic,
|
27857
|
+
diagnostics,
|
27858
|
+
55 /* FieldGetterDeclaration */,
|
27859
|
+
56 /* FieldSetterDeclaration */
|
27860
|
+
);
|
27861
|
+
}
|
27862
|
+
static validateIndexedElementAccessorsHaveConsistentModifiers(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27863
|
+
this.validateTypeMemberAccessorsHaveConsistentModifiers(
|
27864
|
+
analyzer,
|
27865
|
+
getterModifiers,
|
27866
|
+
setterModifiers,
|
27867
|
+
nodeForDiagnostic,
|
27868
|
+
diagnostics,
|
27869
|
+
47 /* IndexedElementGetterDeclaration */,
|
27870
|
+
48 /* IndexedElementSetterDeclaration */
|
27871
|
+
);
|
27872
|
+
}
|
27873
|
+
static validateDereferencedVariableAccessorsHaveConsistentModifiers(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27874
|
+
this.validateTypeMemberAccessorsHaveConsistentModifiers(
|
27875
|
+
analyzer,
|
27876
|
+
getterModifiers,
|
27877
|
+
setterModifiers,
|
27878
|
+
nodeForDiagnostic,
|
27879
|
+
diagnostics,
|
27880
|
+
50 /* DereferencedVariableGetterDeclaration */,
|
27881
|
+
51 /* DereferencedVariableSetterDeclaration */
|
27882
|
+
);
|
27883
|
+
}
|
27884
|
+
validateTopLevelPackageMembers(list) {
|
27885
|
+
this.validatePackageMembers(list, 0 /* None */);
|
27886
|
+
}
|
27887
|
+
validateTopLevelTypeMembers(list, declarationWithMembersKind, isTypeMarkedAbstract, isTypeMarkedBasic) {
|
27888
|
+
this.validateTypeMembers(
|
27889
|
+
list,
|
27890
|
+
declarationWithMembersKind,
|
27891
|
+
isTypeMarkedAbstract,
|
27892
|
+
isTypeMarkedBasic,
|
27893
|
+
0 /* None */
|
27894
|
+
);
|
27895
|
+
}
|
27896
|
+
static validateTypeMemberAccessorsHaveConsistentModifiers(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics, getterNodeKind, setterNodeKind) {
|
27897
|
+
const allowedGetterModifiers = getterModifiers & this.allowedModifiersByTypeMemberDeclarationKind[getterNodeKind];
|
27898
|
+
const allowedSetterModifiers = setterModifiers & this.allowedModifiersByTypeMemberDeclarationKind[setterNodeKind];
|
27899
|
+
if (this.validateTypeMemberSetterHasMoreRestrictiveHidingLevel(
|
27900
|
+
analyzer,
|
27901
|
+
allowedGetterModifiers,
|
27902
|
+
allowedSetterModifiers,
|
27903
|
+
nodeForDiagnostic,
|
27904
|
+
diagnostics
|
27905
|
+
)) {
|
27906
|
+
const getterModifiersWithoutHiding = allowedGetterModifiers & ~31 /* AnyHiddenModifier */;
|
27907
|
+
const setterModifiersWithoutHiding = allowedSetterModifiers & ~31 /* AnyHiddenModifier */;
|
27908
|
+
if (getterModifiersWithoutHiding !== setterModifiersWithoutHiding) {
|
27909
|
+
this.reportSetterMustHaveSameModifiersAsGetter(analyzer, nodeForDiagnostic, diagnostics);
|
27910
|
+
}
|
27911
|
+
}
|
27912
|
+
}
|
27913
|
+
static validatePackageMemberSetterHasMoreRestrictiveHidingLevel(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27914
|
+
let result = true;
|
27915
|
+
if ((getterModifiers & 31 /* AnyHiddenModifier */) === 0) {
|
27916
|
+
result = true;
|
27917
|
+
} else if ((getterModifiers & 17 /* HiddenInPackageOrWithoutLevel */) !== 0) {
|
27918
|
+
if ((setterModifiers & (17 /* HiddenInPackageOrWithoutLevel */ | 8 /* HiddenInFile */)) === 0) {
|
27919
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27920
|
+
result = false;
|
27921
|
+
}
|
27922
|
+
} else if ((getterModifiers & 8 /* HiddenInFile */) !== 0) {
|
27923
|
+
if ((setterModifiers & 8 /* HiddenInFile */) === 0) {
|
27924
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27925
|
+
result = false;
|
27926
|
+
}
|
27927
|
+
}
|
27928
|
+
return result;
|
27929
|
+
}
|
27930
|
+
static validateTypeMemberSetterHasMoreRestrictiveHidingLevel(analyzer, getterModifiers, setterModifiers, nodeForDiagnostic, diagnostics) {
|
27931
|
+
let result = true;
|
27932
|
+
if ((getterModifiers & 31 /* AnyHiddenModifier */) === 0) {
|
27933
|
+
result = true;
|
27934
|
+
} else if ((getterModifiers & 16 /* HiddenInPackage */) !== 0) {
|
27935
|
+
if ((setterModifiers & (17 /* HiddenInPackageOrWithoutLevel */ | 8 /* HiddenInFile */)) === 0) {
|
27936
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27937
|
+
result = false;
|
27938
|
+
}
|
27939
|
+
} else if ((getterModifiers & 8 /* HiddenInFile */) !== 0) {
|
27940
|
+
if ((setterModifiers & (8 /* HiddenInFile */ | 3 /* HiddenInTypeOrWithoutLevel */)) === 0) {
|
27941
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27942
|
+
result = false;
|
27943
|
+
}
|
27944
|
+
} else if ((getterModifiers & 4 /* HiddenInHierarchy */) !== 0) {
|
27945
|
+
if ((setterModifiers & (4 /* HiddenInHierarchy */ | 3 /* HiddenInTypeOrWithoutLevel */)) === 0) {
|
27946
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27947
|
+
result = false;
|
27948
|
+
}
|
27949
|
+
} else if ((getterModifiers & 3 /* HiddenInTypeOrWithoutLevel */) !== 0) {
|
27950
|
+
if ((setterModifiers & 3 /* HiddenInTypeOrWithoutLevel */) === 0) {
|
27951
|
+
this.reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics);
|
27952
|
+
result = false;
|
27953
|
+
}
|
27954
|
+
}
|
27955
|
+
return result;
|
27956
|
+
}
|
27957
|
+
static reportMoreRestrictiveHidingLevelIsRequired(analyzer, nodeForDiagnostic, diagnostics) {
|
27958
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
27959
|
+
335 /* WriteFunctionMustHaveTheSameOrMoreRestrictiveHidingLevelThenReadFunction */,
|
27960
|
+
nodeForDiagnostic
|
27961
|
+
));
|
27962
|
+
}
|
27963
|
+
static reportSetterMustHaveSameModifiersAsGetter(analyzer, nodeForDiagnostic, diagnostics) {
|
27964
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
27965
|
+
334 /* WriteFunctionMustHaveTheSameModifiersAsReadFunction */,
|
27966
|
+
nodeForDiagnostic
|
27967
|
+
));
|
27968
|
+
}
|
27969
|
+
validatePackageMembers(list, parentGroupFlags) {
|
27970
|
+
for (const declaration of list.declarations) {
|
27971
|
+
switch (declaration.kind) {
|
27972
|
+
case 24 /* PackageMemberGroupDeclaration */: {
|
27973
|
+
const groupFlags = this.validatePackageMemberModifierList(
|
27974
|
+
declaration.modifierList,
|
27975
|
+
2 /* MemberGroupDeclaration */,
|
27976
|
+
parentGroupFlags
|
27977
|
+
);
|
27978
|
+
this.validatePackageMembers(declaration.declarationList, groupFlags);
|
27979
|
+
break;
|
27980
|
+
}
|
27981
|
+
case 35 /* PackageVariableDeclaration */: {
|
27982
|
+
const declarationKind = 11 /* VariableDeclaration */;
|
27983
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
27984
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
27985
|
+
break;
|
27986
|
+
}
|
27987
|
+
case 27 /* PackageFunctionDeclaration */: {
|
27988
|
+
const declarationKind = 6 /* FunctionDeclaration */;
|
27989
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
27990
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
27991
|
+
break;
|
27992
|
+
}
|
27993
|
+
case 36 /* PackageVariableGetterDeclaration */: {
|
27994
|
+
const declarationKind = 12 /* VariableGetterDeclaration */;
|
27995
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
27996
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
27997
|
+
break;
|
27998
|
+
}
|
27999
|
+
case 37 /* PackageVariableSetterDeclaration */: {
|
28000
|
+
const declarationKind = 13 /* VariableSetterDeclaration */;
|
28001
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28002
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28003
|
+
break;
|
28004
|
+
}
|
28005
|
+
case 38 /* PackageVariantTypeDeclaration */: {
|
28006
|
+
const declarationKind = 14 /* VariantTypeDeclaration */;
|
28007
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28008
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28009
|
+
break;
|
28010
|
+
}
|
28011
|
+
case 22 /* PackageAliasTypeDeclaration */: {
|
28012
|
+
const declarationKind = 1 /* AliasTypeDeclaration */;
|
28013
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28014
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28015
|
+
break;
|
28016
|
+
}
|
28017
|
+
case 28 /* PackageFunctionTypeDeclaration */: {
|
28018
|
+
const declarationKind = 7 /* FunctionTypeDeclaration */;
|
28019
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28020
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28021
|
+
break;
|
28022
|
+
}
|
28023
|
+
case 33 /* PackageStructuredTypeDeclaration */: {
|
28024
|
+
let declarationKind;
|
28025
|
+
switch (declaration.body.structuredTypeKindKeyword.keywordKind) {
|
28026
|
+
case 3 /* Aspect */:
|
28027
|
+
declarationKind = 10 /* AspectTypeDeclaration */;
|
28028
|
+
break;
|
28029
|
+
case 4 /* Object */:
|
28030
|
+
declarationKind = 8 /* ObjectTypeDeclaration */;
|
28031
|
+
break;
|
28032
|
+
case 5 /* PlainObject */:
|
28033
|
+
declarationKind = 9 /* PlainObjectTypeDeclaration */;
|
28034
|
+
break;
|
28035
|
+
default:
|
28036
|
+
Debug.never(declaration.body.structuredTypeKindKeyword);
|
28037
|
+
}
|
28038
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28039
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28040
|
+
break;
|
28041
|
+
}
|
28042
|
+
case 40 /* TypeExtensionDeclaration */: {
|
28043
|
+
const declarationKind = 3 /* TypeExtensionDeclaration */;
|
28044
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28045
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28046
|
+
declarationKind,
|
28047
|
+
declaration.extendedTypeClause,
|
28048
|
+
parentGroupFlags
|
28049
|
+
);
|
28050
|
+
break;
|
28051
|
+
}
|
28052
|
+
case 43 /* InvalidPackageMemberDeclaration */: {
|
28053
|
+
const declarationKind = 15 /* InvalidDeclaration */;
|
28054
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28055
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration, parentGroupFlags);
|
28056
|
+
break;
|
28057
|
+
}
|
28058
|
+
case 26 /* PackageEntryPointDeclaration */:
|
28059
|
+
this.validatePackageEntryPointDeclaration(declaration, parentGroupFlags);
|
28060
|
+
break;
|
28061
|
+
case 25 /* PackageConstructorDeclaration */:
|
28062
|
+
this.validatePackageConstructorDeclaration(declaration, parentGroupFlags);
|
28063
|
+
break;
|
28064
|
+
case 21 /* TranslationsDeclaration */:
|
28065
|
+
this.validateTranslationsDeclaration(declaration, parentGroupFlags);
|
28066
|
+
break;
|
28067
|
+
default:
|
28068
|
+
Debug.never(declaration);
|
28069
|
+
}
|
28070
|
+
}
|
28071
|
+
}
|
28072
|
+
validatePackageMemberModifierList(list, declarationKind, parentGroupFlags) {
|
28073
|
+
let flags = parentGroupFlags;
|
28074
|
+
for (const modifier of list.modifiers) {
|
28075
|
+
switch (modifier.value.keywordKind) {
|
28076
|
+
case 37 /* Hidden */: {
|
28077
|
+
const flag = modifierToModifierFlag(modifier);
|
28078
|
+
if ((flags & 31 /* AnyHiddenModifier */) !== 0) {
|
28079
|
+
this.reportDuplicateHiddenModifier(modifier, parentGroupFlags);
|
28080
|
+
} else if ((flag & (2 /* HiddenInType */ | 4 /* HiddenInHierarchy */)) !== 0) {
|
28081
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28082
|
+
}
|
28083
|
+
flags |= flag;
|
28084
|
+
break;
|
28085
|
+
}
|
28086
|
+
case 17 /* Basic */: {
|
28087
|
+
const flag = 32 /* Basic */;
|
28088
|
+
if ((flags & flag) !== 0) {
|
28089
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28090
|
+
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 8 /* ObjectTypeDeclaration */)) {
|
28091
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28092
|
+
331 /* BasicModifierCanOnlyBeAppliedToObjectTypes */,
|
28093
|
+
modifier
|
28094
|
+
));
|
28095
|
+
} else if ((flags & 128 /* Abstract */) !== 0) {
|
28096
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 38 /* Abstract */);
|
28097
|
+
}
|
28098
|
+
flags |= flag;
|
28099
|
+
break;
|
28100
|
+
}
|
28101
|
+
case 38 /* Abstract */: {
|
28102
|
+
const flag = 128 /* Abstract */;
|
28103
|
+
if ((flags & flag) !== 0) {
|
28104
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28105
|
+
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 8 /* ObjectTypeDeclaration */)) {
|
28106
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28107
|
+
332 /* AbstractModifierCanOnlyBeAppliedToObjectTypes */,
|
28108
|
+
modifier
|
28109
|
+
));
|
28110
|
+
} else if ((flags & 32 /* Basic */) !== 0) {
|
28111
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 17 /* Basic */);
|
28112
|
+
}
|
28113
|
+
flags |= flag;
|
28114
|
+
break;
|
28115
|
+
}
|
28116
|
+
case 36 /* Const */: {
|
28117
|
+
const flag = 1024 /* Const */;
|
28118
|
+
if ((flags & flag) !== 0) {
|
28119
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28120
|
+
} else if (declarationKind === 2 /* MemberGroupDeclaration */ && (flags & 512 /* Async */) !== 0) {
|
28121
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 40 /* Async */);
|
28122
|
+
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 11 /* VariableDeclaration */)) {
|
28123
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28124
|
+
}
|
28125
|
+
flags |= flag;
|
28126
|
+
break;
|
28127
|
+
}
|
28128
|
+
case 40 /* Async */: {
|
28129
|
+
const flag = 512 /* Async */;
|
28130
|
+
if ((flags & flag) !== 0) {
|
28131
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28132
|
+
} else if (declarationKind === 2 /* MemberGroupDeclaration */ && (flags & 1024 /* Const */) !== 0) {
|
28133
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 36 /* Const */);
|
28134
|
+
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 6 /* FunctionDeclaration */)) {
|
28135
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28136
|
+
}
|
28137
|
+
flags |= flag;
|
28138
|
+
break;
|
28139
|
+
}
|
28140
|
+
case 39 /* Override */:
|
28141
|
+
case 41 /* Static */:
|
28142
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28143
|
+
break;
|
28144
|
+
default:
|
28145
|
+
Debug.never(modifier.value.keywordKind);
|
28146
|
+
}
|
28147
|
+
}
|
28148
|
+
return flags;
|
28149
|
+
}
|
28150
|
+
validatePackageMemberCanBePlacedInGroupWithModifiers(kind, nodeForDiagnostic, parentGroupFlags) {
|
28151
|
+
const notAllowedFlags = _ModifierValidator.allowedModifiersByPackageMemberDeclarationKind[kind] ^ _ModifierValidator.allowedPackageMemberModifiers;
|
28152
|
+
const presentNotAllowedFlags = parentGroupFlags & notAllowedFlags;
|
28153
|
+
if (presentNotAllowedFlags !== 0 /* None */) {
|
28154
|
+
this.forEachModifierFlag(
|
28155
|
+
presentNotAllowedFlags,
|
28156
|
+
(f) => this.reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, f)
|
28157
|
+
);
|
28158
|
+
}
|
28159
|
+
}
|
28160
|
+
validatePackageConstructorDeclaration(node, parentGroupFlags) {
|
28161
|
+
const firstModifier = node.modifierList.modifiers.at(0);
|
28162
|
+
if (firstModifier !== void 0 || parentGroupFlags !== 0 /* None */) {
|
28163
|
+
const nodeForDiagnostic = firstModifier ?? node.creationKeyword;
|
28164
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28165
|
+
323 /* PackageConstructorDeclarationCanNotHaveModifiers */,
|
28166
|
+
nodeForDiagnostic
|
28167
|
+
));
|
28168
|
+
}
|
28169
|
+
}
|
28170
|
+
validatePackageEntryPointDeclaration(node, parentGroupFlags) {
|
28171
|
+
const firstModifier = node.modifierList.modifiers.at(0);
|
28172
|
+
if (firstModifier !== void 0 || parentGroupFlags !== 0 /* None */) {
|
28173
|
+
const nodeForDiagnostic = firstModifier ?? node.runKeyword;
|
28174
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28175
|
+
324 /* PackageEntryPointDeclarationCanNotHaveModifiers */,
|
28176
|
+
nodeForDiagnostic
|
28177
|
+
));
|
28178
|
+
}
|
28179
|
+
}
|
28180
|
+
validateTranslationsDeclaration(node, parentGroupFlags) {
|
28181
|
+
const firstModifier = node.modifierList.modifiers.at(0);
|
28182
|
+
if (firstModifier !== void 0 || parentGroupFlags !== 0 /* None */) {
|
28183
|
+
const nodeForDiagnostic = firstModifier ?? node.translationsKeyword;
|
28184
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28185
|
+
325 /* TranslationsCanNotHaveModifiers */,
|
28186
|
+
nodeForDiagnostic
|
28187
|
+
));
|
28188
|
+
}
|
28189
|
+
}
|
28190
|
+
validateTypeMembers(list, declarationWithMembersKind, isTypeMarkedAbstract, isTypeMarkedBasic, parentGroupFlags) {
|
28191
|
+
for (const declaration of list.members) {
|
28192
|
+
const flags = this.validateTypeMemberModifierList(
|
28193
|
+
declaration.modifierList,
|
28194
|
+
declaration.kind,
|
28195
|
+
declarationWithMembersKind,
|
28196
|
+
isTypeMarkedAbstract,
|
28197
|
+
isTypeMarkedBasic,
|
28198
|
+
parentGroupFlags
|
28199
|
+
);
|
28200
|
+
switch (declaration.kind) {
|
28201
|
+
case 44 /* TypeMemberGroupDeclaration */:
|
28202
|
+
this.validateTypeMembers(
|
28203
|
+
declaration.memberBlock.memberList,
|
28204
|
+
declarationWithMembersKind,
|
28205
|
+
isTypeMarkedAbstract,
|
28206
|
+
isTypeMarkedBasic,
|
28207
|
+
flags
|
28208
|
+
);
|
28209
|
+
break;
|
28210
|
+
case 45 /* ConstructorDeclaration */:
|
28211
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28212
|
+
declaration.kind,
|
28213
|
+
declaration.creationKeyword,
|
28214
|
+
parentGroupFlags
|
28215
|
+
);
|
28216
|
+
break;
|
28217
|
+
case 46 /* DestructorDeclaration */:
|
28218
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28219
|
+
declaration.kind,
|
28220
|
+
declaration.destructionKeyword,
|
28221
|
+
parentGroupFlags
|
28222
|
+
);
|
28223
|
+
break;
|
28224
|
+
case 47 /* IndexedElementGetterDeclaration */:
|
28225
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28226
|
+
declaration.kind,
|
28227
|
+
declaration.parameterClause,
|
28228
|
+
parentGroupFlags
|
28229
|
+
);
|
28230
|
+
break;
|
28231
|
+
case 48 /* IndexedElementSetterDeclaration */:
|
28232
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28233
|
+
declaration.kind,
|
28234
|
+
declaration.parameterClause,
|
28235
|
+
parentGroupFlags
|
28236
|
+
);
|
28237
|
+
break;
|
28238
|
+
case 50 /* DereferencedVariableGetterDeclaration */:
|
28239
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28240
|
+
declaration.kind,
|
28241
|
+
declaration.caretToken,
|
28242
|
+
parentGroupFlags
|
28243
|
+
);
|
28244
|
+
break;
|
28245
|
+
case 51 /* DereferencedVariableSetterDeclaration */:
|
28246
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28247
|
+
declaration.kind,
|
28248
|
+
declaration.caretToken,
|
28249
|
+
parentGroupFlags
|
28250
|
+
);
|
28251
|
+
break;
|
28252
|
+
case 52 /* MethodDeclaration */:
|
28253
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28254
|
+
declaration.kind,
|
28255
|
+
declaration.name,
|
28256
|
+
parentGroupFlags
|
28257
|
+
);
|
28258
|
+
break;
|
28259
|
+
case 53 /* OperatorDeclaration */:
|
28260
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28261
|
+
declaration.kind,
|
28262
|
+
declaration.name,
|
28263
|
+
parentGroupFlags
|
28264
|
+
);
|
28265
|
+
break;
|
28266
|
+
case 54 /* FieldDeclaration */:
|
28267
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28268
|
+
declaration.kind,
|
28269
|
+
declaration.name,
|
28270
|
+
parentGroupFlags
|
28271
|
+
);
|
28272
|
+
break;
|
28273
|
+
case 55 /* FieldGetterDeclaration */:
|
28274
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28275
|
+
declaration.kind,
|
28276
|
+
declaration.name,
|
28277
|
+
parentGroupFlags
|
28278
|
+
);
|
28279
|
+
break;
|
28280
|
+
case 56 /* FieldSetterDeclaration */:
|
28281
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28282
|
+
declaration.kind,
|
28283
|
+
declaration.name,
|
28284
|
+
parentGroupFlags
|
28285
|
+
);
|
28286
|
+
break;
|
28287
|
+
case 57 /* InvalidTypeMemberDeclaration */:
|
28288
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28289
|
+
declaration.kind,
|
28290
|
+
declaration,
|
28291
|
+
parentGroupFlags
|
28292
|
+
);
|
28293
|
+
break;
|
28294
|
+
case 142 /* VariantDeclaration */:
|
28295
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28296
|
+
declaration.kind,
|
28297
|
+
declaration.name,
|
28298
|
+
parentGroupFlags
|
28299
|
+
);
|
28300
|
+
break;
|
28301
|
+
default:
|
28302
|
+
Debug.never(declaration);
|
28303
|
+
}
|
28304
|
+
}
|
28305
|
+
}
|
28306
|
+
validateTypeMemberModifierList(list, typeMemberDeclarationKind, declarationWithMembersKind, isTypeMarkedAbstract, isTypeMarkedBasic, parentGroupFlags) {
|
28307
|
+
let flags = parentGroupFlags;
|
28308
|
+
for (const modifier of list.modifiers) {
|
28309
|
+
switch (modifier.value.keywordKind) {
|
28310
|
+
case 37 /* Hidden */: {
|
28311
|
+
const flag = modifierToModifierFlag(modifier);
|
28312
|
+
if ((flags & 31 /* AnyHiddenModifier */) !== 0) {
|
28313
|
+
this.reportDuplicateHiddenModifier(modifier, parentGroupFlags);
|
28314
|
+
} else if (typeMemberDeclarationKind === 142 /* VariantDeclaration */) {
|
28315
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28316
|
+
330 /* VariantDeclarationCanNotHaveHiddenModifier */,
|
28317
|
+
modifier
|
28318
|
+
));
|
28319
|
+
} else if ((flag & 3 /* HiddenInTypeOrWithoutLevel */) !== 0 && (flags & 128 /* Abstract */) !== 0) {
|
28320
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 38 /* Abstract */);
|
28321
|
+
} else if ((flag & 3 /* HiddenInTypeOrWithoutLevel */) !== 0 && (flags & 32 /* Basic */) !== 0) {
|
28322
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 17 /* Basic */);
|
28323
|
+
}
|
28324
|
+
flags |= flag;
|
28325
|
+
break;
|
28326
|
+
}
|
28327
|
+
case 38 /* Abstract */: {
|
28328
|
+
const flag = 128 /* Abstract */;
|
28329
|
+
if ((flags & flag) !== 0) {
|
28330
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28331
|
+
} else if (!(isTypeMarkedAbstract && declarationWithMembersKind === 0 /* ObjectType */)) {
|
28332
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28333
|
+
326 /* AbstractModifierCanOnlyBeUsedInAbstractObjectTypes */,
|
28334
|
+
modifier
|
28335
|
+
));
|
28336
|
+
} else if (!this.typeMemberAllowsAbstractModifier(typeMemberDeclarationKind)) {
|
28337
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28338
|
+
} else if ((flags & 3 /* HiddenInTypeOrWithoutLevel */) !== 0) {
|
28339
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28340
|
+
modifier,
|
28341
|
+
37 /* Hidden */,
|
28342
|
+
51 /* InType */
|
28343
|
+
);
|
28344
|
+
} else if ((flags & 64 /* Static */) !== 0) {
|
28345
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 41 /* Static */);
|
28346
|
+
} else if ((flags & 32 /* Basic */) !== 0) {
|
28347
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 17 /* Basic */);
|
28348
|
+
} else if ((flags & 256 /* Override */) !== 0) {
|
28349
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 39 /* Override */);
|
28350
|
+
}
|
28351
|
+
flags |= flag;
|
28352
|
+
break;
|
28353
|
+
}
|
28354
|
+
case 17 /* Basic */: {
|
28355
|
+
const flag = 32 /* Basic */;
|
28356
|
+
if ((flags & flag) !== 0) {
|
28357
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28358
|
+
} else if (!(declarationWithMembersKind === 0 /* ObjectType */ || declarationWithMembersKind === 2 /* AspectType */ || declarationWithMembersKind === 4 /* AliasType */ || declarationWithMembersKind === 5 /* TypeExtension */)) {
|
28359
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28360
|
+
327 /* BasicModifierCanOnlyBeUsedInObjectTypesAspectTypesAndTypeAliases */,
|
28361
|
+
modifier
|
28362
|
+
));
|
28363
|
+
} else if (!this.typeMemberAllowsBasicModifier(typeMemberDeclarationKind)) {
|
28364
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28365
|
+
} else if (declarationWithMembersKind === 0 /* ObjectType */ && !(isTypeMarkedAbstract || isTypeMarkedBasic)) {
|
28366
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28367
|
+
333 /* NotBasicObjectTypesCanNotHaveBasicMembers */,
|
28368
|
+
modifier
|
28369
|
+
));
|
28370
|
+
} else if ((flags & 3 /* HiddenInTypeOrWithoutLevel */) !== 0) {
|
28371
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28372
|
+
modifier,
|
28373
|
+
37 /* Hidden */,
|
28374
|
+
51 /* InType */
|
28375
|
+
);
|
28376
|
+
} else if ((flags & 128 /* Abstract */) !== 0) {
|
28377
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 38 /* Abstract */);
|
28378
|
+
} else if ((flags & 64 /* Static */) !== 0) {
|
28379
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 41 /* Static */);
|
28380
|
+
} else if ((flags & 256 /* Override */) !== 0) {
|
28381
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 39 /* Override */);
|
28382
|
+
}
|
28383
|
+
flags |= flag;
|
28384
|
+
break;
|
28385
|
+
}
|
28386
|
+
case 39 /* Override */: {
|
28387
|
+
const flag = 256 /* Override */;
|
28388
|
+
if ((flags & flag) !== 0) {
|
28389
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28390
|
+
} else if (!(declarationWithMembersKind === 0 /* ObjectType */ || declarationWithMembersKind === 1 /* PlainObjectType */ || declarationWithMembersKind === 2 /* AspectType */)) {
|
28391
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28392
|
+
328 /* OverrideModifierCanOnlyBeUsedInObjectAndAspectTypes */,
|
28393
|
+
modifier
|
28394
|
+
));
|
28395
|
+
} else if (!this.typeMemberAllowsOverrideModifier(typeMemberDeclarationKind)) {
|
28396
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28397
|
+
} else if ((flags & 128 /* Abstract */) !== 0) {
|
28398
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 38 /* Abstract */);
|
28399
|
+
} else if ((flags & 32 /* Basic */) !== 0) {
|
28400
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 17 /* Basic */);
|
28401
|
+
} else if ((flags & 64 /* Static */) !== 0) {
|
28402
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 41 /* Static */);
|
28403
|
+
}
|
28404
|
+
flags |= flag;
|
28405
|
+
break;
|
28406
|
+
}
|
28407
|
+
case 41 /* Static */: {
|
28408
|
+
const flag = 64 /* Static */;
|
28409
|
+
if ((flags & flag) !== 0) {
|
28410
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28411
|
+
} else if (!this.typeMemberAllowsStaticModifier(typeMemberDeclarationKind)) {
|
28412
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28413
|
+
} else if ((flags & 128 /* Abstract */) !== 0) {
|
28414
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 38 /* Abstract */);
|
28415
|
+
} else if ((flags & 32 /* Basic */) !== 0) {
|
28416
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 17 /* Basic */);
|
28417
|
+
} else if ((flags & 256 /* Override */) !== 0) {
|
28418
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 39 /* Override */);
|
28419
|
+
}
|
28420
|
+
flags |= flag;
|
28421
|
+
break;
|
28422
|
+
}
|
28423
|
+
case 36 /* Const */: {
|
28424
|
+
const flag = 1024 /* Const */;
|
28425
|
+
if ((flags & flag) !== 0) {
|
28426
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28427
|
+
} else if (typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ && (flags & 512 /* Async */) !== 0) {
|
28428
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 40 /* Async */);
|
28429
|
+
} else if (!(typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ || typeMemberDeclarationKind === 54 /* FieldDeclaration */)) {
|
28430
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28431
|
+
}
|
28432
|
+
flags |= flag;
|
28433
|
+
break;
|
28434
|
+
}
|
28435
|
+
case 40 /* Async */: {
|
28436
|
+
const flag = 512 /* Async */;
|
28437
|
+
if ((flags & flag) !== 0) {
|
28438
|
+
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28439
|
+
} else if (typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ && (flags & 1024 /* Const */) !== 0) {
|
28440
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(modifier, 36 /* Const */);
|
28441
|
+
} else if (!(typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ || typeMemberDeclarationKind === 52 /* MethodDeclaration */)) {
|
28442
|
+
this.reportModifierIsNotAllowedHere(modifier);
|
28443
|
+
}
|
28444
|
+
flags |= flag;
|
28445
|
+
break;
|
28446
|
+
}
|
28447
|
+
default:
|
28448
|
+
Debug.never(modifier.value.keywordKind);
|
28449
|
+
}
|
28450
|
+
}
|
28451
|
+
return flags;
|
28452
|
+
}
|
28453
|
+
validateTypeMemberCanBePlacedInGroupWithModifiers(kind, nodeForDiagnostic, parentGroupFlags) {
|
28454
|
+
const notAllowedFlags = _ModifierValidator.allowedModifiersByTypeMemberDeclarationKind[kind] ^ _ModifierValidator.allowedTypeMemberModifiers;
|
28455
|
+
const presentNotAllowedFlags = parentGroupFlags & notAllowedFlags;
|
28456
|
+
if (presentNotAllowedFlags !== 0 /* None */) {
|
28457
|
+
this.forEachModifierFlag(
|
28458
|
+
presentNotAllowedFlags,
|
28459
|
+
(f) => this.reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, f)
|
28460
|
+
);
|
28461
|
+
}
|
28462
|
+
}
|
28463
|
+
typeMemberAllowsAbstractModifier(kind) {
|
28464
|
+
return (_ModifierValidator.allowedModifiersByTypeMemberDeclarationKind[kind] & 128 /* Abstract */) !== 0;
|
28465
|
+
}
|
28466
|
+
typeMemberAllowsBasicModifier(kind) {
|
28467
|
+
return (_ModifierValidator.allowedModifiersByTypeMemberDeclarationKind[kind] & 32 /* Basic */) !== 0;
|
28468
|
+
}
|
28469
|
+
typeMemberAllowsOverrideModifier(kind) {
|
28470
|
+
return (_ModifierValidator.allowedModifiersByTypeMemberDeclarationKind[kind] & 256 /* Override */) !== 0;
|
28471
|
+
}
|
28472
|
+
typeMemberAllowsStaticModifier(kind) {
|
28473
|
+
return (_ModifierValidator.allowedModifiersByTypeMemberDeclarationKind[kind] & 64 /* Static */) !== 0;
|
28474
|
+
}
|
28475
|
+
reportDuplicateModifier(node, flag, parentGroupFlags) {
|
28476
|
+
const code = (parentGroupFlags & flag) === 0 ? 319 /* ModifierListAlreadyContains0Modifier */ : 320 /* ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier */;
|
28477
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(code, node, [this.displayModifierNode(node)]));
|
28478
|
+
}
|
28479
|
+
reportDuplicateHiddenModifier(node, parentGroupFlags) {
|
28480
|
+
const code = (parentGroupFlags & 31 /* AnyHiddenModifier */) === 0 ? 319 /* ModifierListAlreadyContains0Modifier */ : 320 /* ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier */;
|
28481
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28482
|
+
code,
|
28483
|
+
node,
|
28484
|
+
[this.displayModifier(37 /* Hidden */)]
|
28485
|
+
));
|
28486
|
+
}
|
28487
|
+
reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, modifierFlag) {
|
28488
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28489
|
+
322 /* DeclarationCanNotBePlacedInGroupHaving0Modifier */,
|
28490
|
+
nodeForDiagnostic,
|
28491
|
+
[this.displayModifierFlag(modifierFlag)]
|
28492
|
+
));
|
28493
|
+
}
|
28494
|
+
reportModifierCanNotBeUsedWithAnotherModifier(firstModifier, secondModifierKind, secondModifierLevel) {
|
28495
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28496
|
+
329 /* _0ModifierCanNotBeUsedWith1Modifier */,
|
28497
|
+
firstModifier,
|
28498
|
+
[this.displayModifierNode(firstModifier), this.displayModifier(secondModifierKind, secondModifierLevel)]
|
28499
|
+
));
|
28500
|
+
}
|
28501
|
+
reportModifierIsNotAllowedHere(node) {
|
28502
|
+
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28503
|
+
321 /* _0ModifierIsNotAllowedHere */,
|
28504
|
+
node,
|
28505
|
+
[this.displayModifierNode(node)]
|
28506
|
+
));
|
28507
|
+
}
|
28508
|
+
displayModifierNode(node) {
|
28509
|
+
let result = node.value.tokens.map((t) => t.value).join(" ");
|
28510
|
+
if (node.level !== void 0) {
|
28511
|
+
result += `(${node.level.tokens.map((t) => t.value).join(" ")})`;
|
28512
|
+
}
|
28513
|
+
return result;
|
28514
|
+
}
|
28515
|
+
displayModifierFlag(flag) {
|
28516
|
+
switch (flag) {
|
28517
|
+
case 1 /* HiddenWithoutLevel */:
|
28518
|
+
return this.displayModifier(37 /* Hidden */);
|
28519
|
+
case 2 /* HiddenInType */:
|
28520
|
+
return this.displayModifier(37 /* Hidden */, 51 /* InType */);
|
28521
|
+
case 4 /* HiddenInHierarchy */:
|
28522
|
+
return this.displayModifier(37 /* Hidden */, 48 /* InHierarchy */);
|
28523
|
+
case 8 /* HiddenInFile */:
|
28524
|
+
return this.displayModifier(37 /* Hidden */, 49 /* InFile */);
|
28525
|
+
case 16 /* HiddenInPackage */:
|
28526
|
+
return this.displayModifier(37 /* Hidden */, 50 /* InPackage */);
|
28527
|
+
case 32 /* Basic */:
|
28528
|
+
return this.displayModifier(17 /* Basic */);
|
28529
|
+
case 64 /* Static */:
|
28530
|
+
return this.displayModifier(41 /* Static */);
|
28531
|
+
case 128 /* Abstract */:
|
28532
|
+
return this.displayModifier(38 /* Abstract */);
|
28533
|
+
case 256 /* Override */:
|
28534
|
+
return this.displayModifier(39 /* Override */);
|
28535
|
+
case 512 /* Async */:
|
28536
|
+
return this.displayModifier(40 /* Async */);
|
28537
|
+
case 1024 /* Const */:
|
28538
|
+
return this.displayModifier(36 /* Const */);
|
28539
|
+
case 0 /* None */:
|
28540
|
+
case 2048 /* NotComputed */:
|
28541
|
+
case 31 /* AnyHiddenModifier */:
|
28542
|
+
case 17 /* HiddenInPackageOrWithoutLevel */:
|
28543
|
+
case 3 /* HiddenInTypeOrWithoutLevel */:
|
28544
|
+
return "";
|
28545
|
+
default:
|
28546
|
+
Debug.typeIsAssignableTo();
|
28547
|
+
return "";
|
28548
|
+
}
|
28549
|
+
}
|
28550
|
+
displayModifier(kind, level) {
|
28551
|
+
let result = LocalizationHelper.localizeKeywordAndTakeFirst(kind, this._locale, this._dialect);
|
28552
|
+
if (level !== void 0) {
|
28553
|
+
result += `(${LocalizationHelper.localizeKeywordAndTakeFirst(level, this._locale, this._dialect)})`;
|
28554
|
+
}
|
28555
|
+
return result;
|
28556
|
+
}
|
28557
|
+
forEachModifierFlag(flags, cb) {
|
28558
|
+
for (let flag = 1 /* First */; flag <= 1024 /* Last */; flag <<= 1) {
|
28559
|
+
if ((flags & flag) !== 0) {
|
28560
|
+
cb(flag);
|
28561
|
+
}
|
28562
|
+
}
|
28563
|
+
}
|
28564
|
+
};
|
28565
|
+
|
27579
28566
|
// source/analysis/NodeTypeUtils.ts
|
27580
28567
|
var NodeTypeUtils = class {
|
27581
28568
|
static isTypeDeclaration(node) {
|
@@ -27972,7 +28959,7 @@ var PackageVariableDeclarationEntity = class {
|
|
27972
28959
|
const inferrer = this._typeInferrer.getCachedValue();
|
27973
28960
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
27974
28961
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
27975
|
-
|
28962
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
27976
28963
|
this._node.name
|
27977
28964
|
));
|
27978
28965
|
}
|
@@ -27988,6 +28975,7 @@ var ComputedPackageVariableDeclarationEntity = class {
|
|
27988
28975
|
this.kind = 0 /* Variable */;
|
27989
28976
|
this.subkind = "package";
|
27990
28977
|
this._modifierFlags = 2048 /* NotComputed */;
|
28978
|
+
this._hasReportedAllDiagnostics = false;
|
27991
28979
|
this._analyzer = analyzer;
|
27992
28980
|
this._getterDeclaration = getterDeclaration;
|
27993
28981
|
this._setterDeclaration = setterDeclaration;
|
@@ -28046,6 +29034,23 @@ var ComputedPackageVariableDeclarationEntity = class {
|
|
28046
29034
|
getTags() {
|
28047
29035
|
return this.getGetter()?.getTags() ?? [];
|
28048
29036
|
}
|
29037
|
+
ensureAllDiagnosticsReported() {
|
29038
|
+
if (!this._hasReportedAllDiagnostics) {
|
29039
|
+
const diagnostics = this._analyzer.getAcceptorForDiagnosticsComputedLazily();
|
29040
|
+
if (this._getterDeclaration !== void 0 && this._setterDeclaration !== void 0) {
|
29041
|
+
const getterModifiers = this.modifierFlags;
|
29042
|
+
const setterModifiers = createDeclaredModifierFlags(this._setterDeclaration);
|
29043
|
+
ModifierValidator.validatePackageVariableAccessorsHaveConsistentModifiers(
|
29044
|
+
this._analyzer,
|
29045
|
+
getterModifiers,
|
29046
|
+
setterModifiers,
|
29047
|
+
this._setterDeclaration.name,
|
29048
|
+
diagnostics
|
29049
|
+
);
|
29050
|
+
}
|
29051
|
+
this._hasReportedAllDiagnostics = true;
|
29052
|
+
}
|
29053
|
+
}
|
28049
29054
|
};
|
28050
29055
|
ComputedPackageVariableDeclarationEntity = __decorateClass([
|
28051
29056
|
entityToStringDecorator
|
@@ -28132,7 +29137,7 @@ var FieldDeclarationEntity = class {
|
|
28132
29137
|
const inferrer = this._typeInferrer.getCachedValue();
|
28133
29138
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
28134
29139
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28135
|
-
|
29140
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
28136
29141
|
this._node.name
|
28137
29142
|
));
|
28138
29143
|
}
|
@@ -28149,6 +29154,7 @@ var ComputedFieldDeclarationEntity = class {
|
|
28149
29154
|
this.subkind = "field";
|
28150
29155
|
this._overriddenMembers = new Cached();
|
28151
29156
|
this._modifierFlags = 2048 /* NotComputed */;
|
29157
|
+
this._hasReportedAllDiagnostics = false;
|
28152
29158
|
this._analyzer = analyzer;
|
28153
29159
|
this._getterDeclaration = getterDeclaration;
|
28154
29160
|
this._setterDeclaration = setterDeclaration;
|
@@ -28225,6 +29231,23 @@ var ComputedFieldDeclarationEntity = class {
|
|
28225
29231
|
isVariant() {
|
28226
29232
|
return false;
|
28227
29233
|
}
|
29234
|
+
ensureAllDiagnosticsReported() {
|
29235
|
+
if (!this._hasReportedAllDiagnostics) {
|
29236
|
+
const diagnostics = this._analyzer.getAcceptorForDiagnosticsComputedLazily();
|
29237
|
+
if (this._getterDeclaration !== void 0 && this._setterDeclaration !== void 0) {
|
29238
|
+
const getterModifiers = this.modifierFlags;
|
29239
|
+
const setterModifiers = createDeclaredModifierFlags(this._setterDeclaration);
|
29240
|
+
ModifierValidator.validateFieldAccessorsHaveConsistentModifiers(
|
29241
|
+
this._analyzer,
|
29242
|
+
getterModifiers,
|
29243
|
+
setterModifiers,
|
29244
|
+
this._setterDeclaration.name,
|
29245
|
+
diagnostics
|
29246
|
+
);
|
29247
|
+
}
|
29248
|
+
this._hasReportedAllDiagnostics = true;
|
29249
|
+
}
|
29250
|
+
}
|
28228
29251
|
};
|
28229
29252
|
ComputedFieldDeclarationEntity = __decorateClass([
|
28230
29253
|
entityToStringDecorator
|
@@ -28354,7 +29377,7 @@ var LocalVariableDeclarationEntity = class {
|
|
28354
29377
|
const inferrer = this._typeInferrer.getCachedValue();
|
28355
29378
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
28356
29379
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28357
|
-
|
29380
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
28358
29381
|
this._node.name
|
28359
29382
|
));
|
28360
29383
|
}
|
@@ -28428,7 +29451,7 @@ var EnumerationVariableDeclarationEntity = class {
|
|
28428
29451
|
const inferrer = this._typeInferrer.getCachedValue();
|
28429
29452
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
28430
29453
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28431
|
-
|
29454
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
28432
29455
|
this._node.name
|
28433
29456
|
));
|
28434
29457
|
}
|
@@ -28592,7 +29615,7 @@ var ParameterDeclarationEntity = class {
|
|
28592
29615
|
const inferrer = this._typeInferrer.getCachedValue();
|
28593
29616
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
28594
29617
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28595
|
-
|
29618
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
28596
29619
|
this._node.name
|
28597
29620
|
));
|
28598
29621
|
}
|
@@ -28681,7 +29704,7 @@ var IndexParameterDeclarationEntity = class {
|
|
28681
29704
|
const inferrer = this._typeInferrer.getCachedValue();
|
28682
29705
|
if (inferrer?.hasDetectedInferenceCycle === true) {
|
28683
29706
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28684
|
-
|
29707
|
+
291 /* RecursionOccurredWhileInferringTheTypeOfTheVariable */,
|
28685
29708
|
this._getterOrSetterParameterDeclaration.name
|
28686
29709
|
));
|
28687
29710
|
}
|
@@ -28992,7 +30015,7 @@ var SourcePackageMembersCreator = class {
|
|
28992
30015
|
resultingComputedVariables.set(accessor, entity);
|
28993
30016
|
if (accessor.kind === 37 /* PackageVariableSetterDeclaration */) {
|
28994
30017
|
diagnostics?.addDiagnostic(analyzer.createNodeDiagnostic(
|
28995
|
-
|
30018
|
+
311 /* WriteFunctionHasNoCorrespondingReadFunction */,
|
28996
30019
|
accessor.name
|
28997
30020
|
));
|
28998
30021
|
}
|
@@ -31603,7 +32626,7 @@ var Resolver4 = class {
|
|
31603
32626
|
}
|
31604
32627
|
getNodeForDiagnostics() {
|
31605
32628
|
if (this.callee.kind === 78 /* MemberAccessExpression */) {
|
31606
|
-
return this.callee.
|
32629
|
+
return this.callee.memberName;
|
31607
32630
|
} else {
|
31608
32631
|
return this.callee;
|
31609
32632
|
}
|
@@ -31984,6 +33007,9 @@ var Resolver7 = class {
|
|
31984
33007
|
return this._semanticContext.getOrInsertWith(() => this._analyzer.semanticContext.containing(this._node));
|
31985
33008
|
}
|
31986
33009
|
resolve() {
|
33010
|
+
if (this._node.identifier.isMissing) {
|
33011
|
+
return new ResolutionResult(new Meaning_unresolved5());
|
33012
|
+
}
|
31987
33013
|
if (this._node.identifier.ifOperatorNameThenKind !== void 0) {
|
31988
33014
|
const resolved = this.tryResolveOperatorAccessMeaning(this._node.identifier.ifOperatorNameThenKind);
|
31989
33015
|
if (resolved !== void 0) {
|
@@ -32683,8 +33709,8 @@ var Resolver9 = class {
|
|
32683
33709
|
this._node = node;
|
32684
33710
|
this._targetTypeHint = targetTypeHint;
|
32685
33711
|
}
|
32686
|
-
get
|
32687
|
-
return this._analyzer.createSearchNameFromIdentifier(this._node.
|
33712
|
+
get memberSearchName() {
|
33713
|
+
return this._analyzer.createSearchNameFromIdentifier(this._node.memberName);
|
32688
33714
|
}
|
32689
33715
|
get semanticContext() {
|
32690
33716
|
return this._semanticContext.getOrInsertWith(() => this._analyzer.semanticContext.containing(this._node));
|
@@ -32693,6 +33719,9 @@ var Resolver9 = class {
|
|
32693
33719
|
return this._node.expression;
|
32694
33720
|
}
|
32695
33721
|
resolve() {
|
33722
|
+
if (this._node.memberName.isMissing) {
|
33723
|
+
return new ResolutionResult3(new Meaning_unresolved7());
|
33724
|
+
}
|
32696
33725
|
{
|
32697
33726
|
const info = this._analyzer.checkExpressionDenotesPackageAlias(this.receiver);
|
32698
33727
|
if (info !== void 0) {
|
@@ -32726,7 +33755,7 @@ var Resolver9 = class {
|
|
32726
33755
|
}
|
32727
33756
|
resolvePackageMemberAccessMeaning(package_) {
|
32728
33757
|
const lookup = new PackageMemberLookup(package_, this.semanticContext.getLocalizationContext());
|
32729
|
-
const namedMembers = lookup.getNamedMembersByName(this.
|
33758
|
+
const namedMembers = lookup.getNamedMembersByName(this.memberSearchName, this.semanticContext.getHidingMatcher());
|
32730
33759
|
if (namedMembers.length === 1) {
|
32731
33760
|
const namedMember = namedMembers[0];
|
32732
33761
|
if (namedMember.value.kind === 0 /* Variable */) {
|
@@ -32770,7 +33799,7 @@ var Resolver9 = class {
|
|
32770
33799
|
diagnostic2 = this._analyzer.createAmbiguousFunctionAccessLazyDiagnostic(
|
32771
33800
|
suitableFunctions.length !== 0 ? suitableFunctions : functions,
|
32772
33801
|
this.semanticContext.getLocalizationContext(),
|
32773
|
-
this._node.
|
33802
|
+
this._node.memberName
|
32774
33803
|
);
|
32775
33804
|
}
|
32776
33805
|
return new ResolutionResult3(
|
@@ -32794,7 +33823,7 @@ var Resolver9 = class {
|
|
32794
33823
|
diagnostic2 = this._analyzer.createAmbiguousEntityAccessLazyDiagnostic(
|
32795
33824
|
suitableTypeEntities.length !== 0 ? suitableTypeEntities : types_,
|
32796
33825
|
this.semanticContext.getLocalizationContext(),
|
32797
|
-
this._node.
|
33826
|
+
this._node.memberName
|
32798
33827
|
);
|
32799
33828
|
}
|
32800
33829
|
const suitableTypes = suitableTypeEntities.map((c) => c.withValue(this._analyzer.instantiateType(c.value, typeArguments)));
|
@@ -32803,17 +33832,17 @@ var Resolver9 = class {
|
|
32803
33832
|
const diagnostic = this._analyzer.createAmbiguousEntityAccessLazyDiagnostic(
|
32804
33833
|
namedMembers,
|
32805
33834
|
this.semanticContext.getLocalizationContext(),
|
32806
|
-
this._node.
|
33835
|
+
this._node.memberName
|
32807
33836
|
);
|
32808
33837
|
return new ResolutionResult3(new Meaning_mixedAmbiguousAccess2(namedMembers), diagnostic);
|
32809
33838
|
}
|
32810
33839
|
return new ResolutionResult3(
|
32811
33840
|
new Meaning_unresolved7(),
|
32812
|
-
this._analyzer.createNodeDiagnostic(205 /* PackageMemberNotFound */, this._node.
|
33841
|
+
this._analyzer.createNodeDiagnostic(205 /* PackageMemberNotFound */, this._node.memberName)
|
32813
33842
|
);
|
32814
33843
|
}
|
32815
33844
|
resolvePackageNameSegmentAccessMeaning(packageTreeNode) {
|
32816
|
-
const child = packageTreeNode.getChild(this.
|
33845
|
+
const child = packageTreeNode.getChild(this.memberSearchName.value);
|
32817
33846
|
if (child !== void 0) {
|
32818
33847
|
return new ResolutionResult3(new Meaning_packageNameSegmentAccess2(child));
|
32819
33848
|
}
|
@@ -32822,7 +33851,7 @@ var Resolver9 = class {
|
|
32822
33851
|
}
|
32823
33852
|
return new ResolutionResult3(
|
32824
33853
|
new Meaning_unresolved7(),
|
32825
|
-
this._analyzer.createNodeDiagnostic(204 /* PackageMemberOrPackageNotFound */, this._node.
|
33854
|
+
this._analyzer.createNodeDiagnostic(204 /* PackageMemberOrPackageNotFound */, this._node.memberName)
|
32826
33855
|
);
|
32827
33856
|
}
|
32828
33857
|
createAccessedFunctionFromPackageMember(entity) {
|
@@ -32850,7 +33879,7 @@ var Resolver9 = class {
|
|
32850
33879
|
new Meaning_unresolved7(),
|
32851
33880
|
this._analyzer.createNodeDiagnostic(
|
32852
33881
|
211 /* CannotAccessStaticMembersOnTypeParameter */,
|
32853
|
-
this._node.
|
33882
|
+
this._node.memberName
|
32854
33883
|
)
|
32855
33884
|
);
|
32856
33885
|
}
|
@@ -32860,14 +33889,14 @@ var Resolver9 = class {
|
|
32860
33889
|
this.semanticContext.getLocalizationContext()
|
32861
33890
|
);
|
32862
33891
|
const namedMembers = typeMemberLookup.getNamedMembersByName(
|
32863
|
-
this.
|
33892
|
+
this.memberSearchName,
|
32864
33893
|
2 /* OnlyStaticMembers */,
|
32865
33894
|
this.semanticContext.getHidingMatcher()
|
32866
33895
|
);
|
32867
33896
|
if (namedMembers.length === 0) {
|
32868
33897
|
return new ResolutionResult3(
|
32869
33898
|
new Meaning_unresolved7(),
|
32870
|
-
this._analyzer.createNodeDiagnostic(206 /* TypeMemberNotFound */, this._node.
|
33899
|
+
this._analyzer.createNodeDiagnostic(206 /* TypeMemberNotFound */, this._node.memberName)
|
32871
33900
|
);
|
32872
33901
|
}
|
32873
33902
|
if (namedMembers.length === 1) {
|
@@ -32899,7 +33928,7 @@ var Resolver9 = class {
|
|
32899
33928
|
diagnostic2 = this._analyzer.createAmbiguousFunctionAccessLazyDiagnostic(
|
32900
33929
|
suitableFunctions.length !== 0 ? suitableFunctions : methods,
|
32901
33930
|
this.semanticContext.getLocalizationContext(),
|
32902
|
-
this._node.
|
33931
|
+
this._node.memberName
|
32903
33932
|
);
|
32904
33933
|
}
|
32905
33934
|
return new ResolutionResult3(
|
@@ -32912,7 +33941,7 @@ var Resolver9 = class {
|
|
32912
33941
|
const diagnostic = this._analyzer.createAmbiguousTypeMemberAccessLazyDiagnostic(
|
32913
33942
|
namedMembers,
|
32914
33943
|
this.semanticContext.getLocalizationContext(),
|
32915
|
-
this._node.
|
33944
|
+
this._node.memberName
|
32916
33945
|
);
|
32917
33946
|
return new ResolutionResult3(new Meaning_mixedAmbiguousAccess2(
|
32918
33947
|
namedMembers.map((m) => m.withValue(m.value.getEntity()))
|
@@ -32938,10 +33967,10 @@ var Resolver9 = class {
|
|
32938
33967
|
if (type.kind === "unresolved") {
|
32939
33968
|
return new ResolutionResult3(new Meaning_unresolved7());
|
32940
33969
|
}
|
32941
|
-
if (this._node.
|
33970
|
+
if (this._node.memberName.ifOperatorNameThenKind !== void 0) {
|
32942
33971
|
const resolved = this.tryResolveInstanceOperatorAccessMeaning(
|
32943
33972
|
type,
|
32944
|
-
this._node.
|
33973
|
+
this._node.memberName.ifOperatorNameThenKind
|
32945
33974
|
);
|
32946
33975
|
if (resolved !== void 0) {
|
32947
33976
|
return resolved;
|
@@ -32953,7 +33982,7 @@ var Resolver9 = class {
|
|
32953
33982
|
this.semanticContext.getLocalizationContext()
|
32954
33983
|
);
|
32955
33984
|
const namedMembers = typeMemberLookup.getNamedMembersByName(
|
32956
|
-
this.
|
33985
|
+
this.memberSearchName,
|
32957
33986
|
1 /* OnlyInstanceMembers */,
|
32958
33987
|
this.semanticContext.getHidingMatcher(),
|
32959
33988
|
this.semanticContext
|
@@ -32961,7 +33990,7 @@ var Resolver9 = class {
|
|
32961
33990
|
if (namedMembers.length === 0) {
|
32962
33991
|
return new ResolutionResult3(
|
32963
33992
|
new Meaning_unresolved7(),
|
32964
|
-
this._analyzer.createNodeDiagnostic(206 /* TypeMemberNotFound */, this._node.
|
33993
|
+
this._analyzer.createNodeDiagnostic(206 /* TypeMemberNotFound */, this._node.memberName)
|
32965
33994
|
);
|
32966
33995
|
}
|
32967
33996
|
if (namedMembers.length === 1) {
|
@@ -32993,7 +34022,7 @@ var Resolver9 = class {
|
|
32993
34022
|
diagnostic2 = this._analyzer.createAmbiguousFunctionAccessLazyDiagnostic(
|
32994
34023
|
suitableFunctions.length !== 0 ? suitableFunctions : methods,
|
32995
34024
|
this.semanticContext.getLocalizationContext(),
|
32996
|
-
this._node.
|
34025
|
+
this._node.memberName
|
32997
34026
|
);
|
32998
34027
|
}
|
32999
34028
|
return new ResolutionResult3(
|
@@ -33006,7 +34035,7 @@ var Resolver9 = class {
|
|
33006
34035
|
const diagnostic = this._analyzer.createAmbiguousTypeMemberAccessLazyDiagnostic(
|
33007
34036
|
namedMembers,
|
33008
34037
|
this.semanticContext.getLocalizationContext(),
|
33009
|
-
this._node.
|
34038
|
+
this._node.memberName
|
33010
34039
|
);
|
33011
34040
|
return new ResolutionResult3(
|
33012
34041
|
new Meaning_mixedAmbiguousAccess2(namedMembers.map((m) => m.withValue(m.value.getEntity()))),
|
@@ -33040,7 +34069,7 @@ var Resolver9 = class {
|
|
33040
34069
|
diagnostic = this._analyzer.createAmbiguousTypeMemberAccessLazyDiagnostic(
|
33041
34070
|
suitableOperators.length !== 0 ? suitableOperators : operators,
|
33042
34071
|
this.semanticContext.getLocalizationContext(),
|
33043
|
-
this._node.
|
34072
|
+
this._node.memberName
|
33044
34073
|
);
|
33045
34074
|
}
|
33046
34075
|
return new ResolutionResult3(
|
@@ -33688,7 +34717,7 @@ var PackageMemberNameConflictsValidator = class {
|
|
33688
34717
|
} else {
|
33689
34718
|
this.createAndAddNameConflictDiagnosticsForAllEntities(
|
33690
34719
|
members,
|
33691
|
-
|
34720
|
+
295 /* PackageAlreadyContainsDeclarationWithTheSameName */
|
33692
34721
|
);
|
33693
34722
|
}
|
33694
34723
|
}
|
@@ -33703,7 +34732,7 @@ var PackageMemberNameConflictsValidator = class {
|
|
33703
34732
|
if (this._analyzer.conflictsCheck.doFunctionSignaturesConflict(entity, entityToCheckAgainst) && this.shouldReportConflictWithMemberBasedOnHiding(entity, entityToCheckAgainst)) {
|
33704
34733
|
this.reportNameConflictDiagnostic(
|
33705
34734
|
entity,
|
33706
|
-
|
34735
|
+
296 /* PackageAlreadyContainsFunctionWithTheSameNameAndParameterTypes */
|
33707
34736
|
);
|
33708
34737
|
break;
|
33709
34738
|
}
|
@@ -33719,7 +34748,7 @@ var PackageMemberNameConflictsValidator = class {
|
|
33719
34748
|
if (this._analyzer.conflictsCheck.doPackageTypesConflict(entity, entityToCheckAgainst) && this.shouldReportConflictWithMemberBasedOnHiding(entity, entityToCheckAgainst)) {
|
33720
34749
|
this.reportNameConflictDiagnostic(
|
33721
34750
|
entity,
|
33722
|
-
|
34751
|
+
297 /* PackageAlreadyContainsTypeWithTheSameNameAndSameOrIntersectingTypeParameterCount */
|
33723
34752
|
);
|
33724
34753
|
break;
|
33725
34754
|
}
|
@@ -33819,7 +34848,7 @@ var SourcePackageMemberConflictsValidator = class {
|
|
33819
34848
|
if (constructorDeclarations.length > 1 || entryPointDeclarations.length > 1) {
|
33820
34849
|
const diagnostics = Array.from(nameConflictsValidationDiagnostics);
|
33821
34850
|
if (constructorDeclarations.length > 1) {
|
33822
|
-
const diagnosticData = DiagnosticData.withCode(
|
34851
|
+
const diagnosticData = DiagnosticData.withCode(300 /* PackageCanHaveOnlyOneConstructor */);
|
33823
34852
|
for (const declaration of constructorDeclarations) {
|
33824
34853
|
diagnostics.push(new Diagnostic(
|
33825
34854
|
diagnosticData,
|
@@ -33828,7 +34857,7 @@ var SourcePackageMemberConflictsValidator = class {
|
|
33828
34857
|
}
|
33829
34858
|
}
|
33830
34859
|
if (entryPointDeclarations.length > 1) {
|
33831
|
-
const diagnosticData = DiagnosticData.withCode(
|
34860
|
+
const diagnosticData = DiagnosticData.withCode(299 /* PackageCanHaveOnlyEntryPoint */);
|
33832
34861
|
for (const declaration of entryPointDeclarations) {
|
33833
34862
|
diagnostics.push(new Diagnostic(
|
33834
34863
|
diagnosticData,
|
@@ -33872,7 +34901,7 @@ var SourceFileMembers = class {
|
|
33872
34901
|
const packageAliasesByNameKey = Query.from(this._namedMembers).filter((d) => d.kind === 10 /* PackageAlias */).groupByToMap((a) => a.getName().key);
|
33873
34902
|
for (const [name, aliases] of packageAliasesByNameKey) {
|
33874
34903
|
if (aliases.length > 1) {
|
33875
|
-
const diagnosticData = DiagnosticData.withCode(
|
34904
|
+
const diagnosticData = DiagnosticData.withCode(298 /* PackageAliasWithTheSameNameAlreadyExits */);
|
33876
34905
|
for (const alias of aliases) {
|
33877
34906
|
const diagnosticLocation = this.getDiagnosticLocation(alias);
|
33878
34907
|
if (diagnosticLocation !== void 0) {
|
@@ -33885,7 +34914,7 @@ var SourceFileMembers = class {
|
|
33885
34914
|
const diagnosticLocation = this.getDiagnosticLocation(aliases[0]);
|
33886
34915
|
if (diagnosticLocation !== void 0) {
|
33887
34916
|
const diagnosticData = DiagnosticData.withCode(
|
33888
|
-
|
34917
|
+
295 /* PackageAlreadyContainsDeclarationWithTheSameName */
|
33889
34918
|
);
|
33890
34919
|
diagnostics.addDiagnostic(new Diagnostic(diagnosticData, diagnosticLocation));
|
33891
34920
|
}
|
@@ -33947,7 +34976,7 @@ var Resolver11 = class {
|
|
33947
34976
|
previousPackageRelatedQualifier = resolvedQualifier;
|
33948
34977
|
} else {
|
33949
34978
|
if (i !== qualifiers.length - 1) {
|
33950
|
-
diagnostic = this._analyzer.createNodeDiagnostic(
|
34979
|
+
diagnostic = this._analyzer.createNodeDiagnostic(286 /* PackageNameOrAliasExpected */, qualifier);
|
33951
34980
|
}
|
33952
34981
|
break;
|
33953
34982
|
}
|
@@ -33959,7 +34988,7 @@ var Resolver11 = class {
|
|
33959
34988
|
const lastQualifierIdentifier = qualifiers[qualifiers.length - 1];
|
33960
34989
|
if (!(lastQualifier.kind === "type" || lastQualifier.kind === "function")) {
|
33961
34990
|
const diagnostic2 = this._analyzer.createNodeDiagnostic(
|
33962
|
-
|
34991
|
+
285 /* TypeOrFunctionNameExpected */,
|
33963
34992
|
lastQualifierIdentifier
|
33964
34993
|
);
|
33965
34994
|
return new ResolutionResult4(new Meaning_unresolved9(), resolvedQualifiers, diagnostic2);
|
@@ -33978,7 +35007,7 @@ var Resolver11 = class {
|
|
33978
35007
|
let ambiguousDeclarations;
|
33979
35008
|
const declarations = this.semanticContext.getNamedDeclarationsByName(name);
|
33980
35009
|
if (declarations.length === 0) {
|
33981
|
-
diagnostic = this._analyzer.createNodeDiagnostic(
|
35010
|
+
diagnostic = this._analyzer.createNodeDiagnostic(284 /* TagNotFound */, nodeForDiagnostic);
|
33982
35011
|
} else if (declarations.length === 1) {
|
33983
35012
|
const declaration = declarations[0];
|
33984
35013
|
switch (declaration.value.kind) {
|
@@ -33999,7 +35028,7 @@ var Resolver11 = class {
|
|
33999
35028
|
break;
|
34000
35029
|
case "variable":
|
34001
35030
|
diagnostic = this._analyzer.createNodeDiagnostic(
|
34002
|
-
|
35031
|
+
285 /* TypeOrFunctionNameExpected */,
|
34003
35032
|
nodeForDiagnostic
|
34004
35033
|
);
|
34005
35034
|
break;
|
@@ -34048,12 +35077,12 @@ var Resolver11 = class {
|
|
34048
35077
|
if (resolvedQualifier === void 0) {
|
34049
35078
|
const packageEntity = qualifier.kind === "package-alias" ? qualifier.packageAlias.getPackage() : qualifier.packageTreeNode.package?.value;
|
34050
35079
|
if (packageEntity === void 0) {
|
34051
|
-
diagnostic = this._analyzer.createNodeDiagnostic(
|
35080
|
+
diagnostic = this._analyzer.createNodeDiagnostic(284 /* TagNotFound */, nodeForDiagnostic);
|
34052
35081
|
} else {
|
34053
35082
|
const lookup = new PackageMemberLookup(packageEntity, this.semanticContext.getLocalizationContext());
|
34054
35083
|
const declarations = lookup.getNamedMembersByName(name, this.semanticContext.getHidingMatcher());
|
34055
35084
|
if (declarations.length === 0) {
|
34056
|
-
diagnostic = this._analyzer.createNodeDiagnostic(
|
35085
|
+
diagnostic = this._analyzer.createNodeDiagnostic(284 /* TagNotFound */, nodeForDiagnostic);
|
34057
35086
|
} else if (declarations.length === 1) {
|
34058
35087
|
const declaration = declarations[0];
|
34059
35088
|
switch (declaration.value.kind) {
|
@@ -34071,7 +35100,7 @@ var Resolver11 = class {
|
|
34071
35100
|
break;
|
34072
35101
|
case 0 /* Variable */:
|
34073
35102
|
diagnostic = this._analyzer.createNodeDiagnostic(
|
34074
|
-
|
35103
|
+
285 /* TypeOrFunctionNameExpected */,
|
34075
35104
|
nodeForDiagnostic
|
34076
35105
|
);
|
34077
35106
|
break;
|
@@ -35017,7 +36046,7 @@ var GraphBuilder = class {
|
|
35017
36046
|
}
|
35018
36047
|
addUnreachableCodeDiagnostic(node) {
|
35019
36048
|
const data = DiagnosticData.withCode(
|
35020
|
-
|
36049
|
+
289 /* UnreachableCode */,
|
35021
36050
|
[],
|
35022
36051
|
3 /* Hint */,
|
35023
36052
|
2 /* Unreachable */
|
@@ -37333,7 +38362,7 @@ var SemanticContextValidatingNameConflictsBase = class extends SemanticContextWi
|
|
37333
38362
|
if (members.every((m) => m.kind === 1 /* Function */)) {
|
37334
38363
|
this.validateNestedFunctionsConflicts(members, sourceFile, diagnostics);
|
37335
38364
|
} else {
|
37336
|
-
const diagnosticData = DiagnosticData.withCode(
|
38365
|
+
const diagnosticData = DiagnosticData.withCode(292 /* ScopeAlreadyContainsDeclarationWithTheSameName */);
|
37337
38366
|
const preferSetterParameter = this.getContainingSubprogram()?.kind === "setter";
|
37338
38367
|
for (const member of members) {
|
37339
38368
|
const diagnosticRange = getDiagnosticRange(member, preferSetterParameter);
|
@@ -37364,7 +38393,7 @@ var SemanticContextValidatingNameConflictsBase = class extends SemanticContextWi
|
|
37364
38393
|
const diagnosticRange = getDiagnosticRange(entity);
|
37365
38394
|
if (diagnosticRange !== void 0) {
|
37366
38395
|
const diagnosticData = DiagnosticData.withCode(
|
37367
|
-
|
38396
|
+
293 /* ScopeAlreadyContainsFunctionWithTheSameNameAndParameterTypes */
|
37368
38397
|
);
|
37369
38398
|
diagnostics.addDiagnostic(new Diagnostic(
|
37370
38399
|
diagnosticData,
|
@@ -37786,7 +38815,7 @@ var SubprogramTypeParameterSemanticContext = class extends SemanticContextValida
|
|
37786
38815
|
if (name.considerEqual(resultSpecialName)) {
|
37787
38816
|
diagnostics.addDiagnostic(new Diagnostic(
|
37788
38817
|
DiagnosticData.withCode(
|
37789
|
-
|
38818
|
+
294 /* ParameterName0ConflictsWithAutomaticallyGeneratedVariableName */,
|
37790
38819
|
[resultSpecialName.unescapedOriginal]
|
37791
38820
|
),
|
37792
38821
|
new DiagnosticLocation(parameter.name.rangeWithoutTrivia, sourceFile)
|
@@ -37838,7 +38867,7 @@ var ExplicitSubprogramParameterSemanticContext = class extends SubprogramParamet
|
|
37838
38867
|
const originalName = equalsResultSpecialName ? resultSpecialName.unescapedOriginal : valueSpecialName.unescapedOriginal;
|
37839
38868
|
diagnostics.addDiagnostic(new Diagnostic(
|
37840
38869
|
DiagnosticData.withCode(
|
37841
|
-
|
38870
|
+
294 /* ParameterName0ConflictsWithAutomaticallyGeneratedVariableName */,
|
37842
38871
|
[originalName]
|
37843
38872
|
),
|
37844
38873
|
new DiagnosticLocation(parameter.name.rangeWithoutTrivia, sourceFile)
|
@@ -38369,7 +39398,7 @@ var Analyzer = class _Analyzer {
|
|
38369
39398
|
this._functionBlockWithYieldStatementCheckResults = /* @__PURE__ */ new Map();
|
38370
39399
|
this._namedDeclarationsUsageCountResults = /* @__PURE__ */ new Map();
|
38371
39400
|
this._controlFlowGraphs = /* @__PURE__ */ new Map();
|
38372
|
-
this._diagnosticsComputedLazily =
|
39401
|
+
this._diagnosticsComputedLazily = new Array();
|
38373
39402
|
this._diagnosticsComputedLazilyAcceptor = new Cached();
|
38374
39403
|
this._sourcePackageMemberConflictsDiagnostics = /* @__PURE__ */ new Map();
|
38375
39404
|
this.compilation = compilation;
|
@@ -38851,26 +39880,6 @@ var Analyzer = class _Analyzer {
|
|
38851
39880
|
const locale = this.entity.ofPackage(sourceFile.package).getLocale();
|
38852
39881
|
return new LocalizationContext(translationPackages, locale);
|
38853
39882
|
}
|
38854
|
-
typeIsValidBaseObjectType(type) {
|
38855
|
-
if (type.kind === "structured" && type.isRefObject()) {
|
38856
|
-
return true;
|
38857
|
-
}
|
38858
|
-
if (type.kind === "alias") {
|
38859
|
-
const aliased = unaliasType(type);
|
38860
|
-
return this.typeIsValidBaseObjectType(aliased);
|
38861
|
-
}
|
38862
|
-
return false;
|
38863
|
-
}
|
38864
|
-
typeIsValidBaseAspectType(type) {
|
38865
|
-
if (type.kind === "structured" && type.isAspect()) {
|
38866
|
-
return true;
|
38867
|
-
}
|
38868
|
-
if (type.kind === "alias") {
|
38869
|
-
const aliased = unaliasType(type);
|
38870
|
-
return this.typeIsValidBaseAspectType(aliased);
|
38871
|
-
}
|
38872
|
-
return false;
|
38873
|
-
}
|
38874
39883
|
getImplicitBaseTypeForStructuredType(entity) {
|
38875
39884
|
const refObject = this.standardTypes.refObject;
|
38876
39885
|
Debug.assert(refObject.kind === "structured");
|
@@ -39936,17 +40945,7 @@ var Analyzer = class _Analyzer {
|
|
39936
40945
|
return new Lazy(() => this.createAmbiguousNamedScopeDeclarationAccessDiagnostic(declarations, lctx, node));
|
39937
40946
|
}
|
39938
40947
|
addDiagnosticComputedLazily(diagnostic) {
|
39939
|
-
|
39940
|
-
const sourceFile = this.compilation.getSourceFileByUri(diagnostic.location.file.uri);
|
39941
|
-
if (sourceFile !== void 0) {
|
39942
|
-
let diagnostics = this._diagnosticsComputedLazily.get(sourceFile);
|
39943
|
-
if (diagnostics === void 0) {
|
39944
|
-
diagnostics = [];
|
39945
|
-
this._diagnosticsComputedLazily.set(sourceFile, diagnostics);
|
39946
|
-
}
|
39947
|
-
diagnostics.push(diagnostic);
|
39948
|
-
}
|
39949
|
-
}
|
40948
|
+
this._diagnosticsComputedLazily.push(diagnostic);
|
39950
40949
|
}
|
39951
40950
|
getAcceptorForDiagnosticsComputedLazily() {
|
39952
40951
|
return this._diagnosticsComputedLazilyAcceptor.getOrInsertWith(() => {
|
@@ -39957,8 +40956,11 @@ var Analyzer = class _Analyzer {
|
|
39957
40956
|
};
|
39958
40957
|
});
|
39959
40958
|
}
|
39960
|
-
|
39961
|
-
return this._diagnosticsComputedLazily.
|
40959
|
+
getSourceFileDiagnosticsComputedLazily(sourceFile) {
|
40960
|
+
return this._diagnosticsComputedLazily.filter((d) => d.location?.file === sourceFile);
|
40961
|
+
}
|
40962
|
+
getDiagnosticsWithoutLocationComputedLazily() {
|
40963
|
+
return this._diagnosticsComputedLazily.filter((d) => d.location === void 0);
|
39962
40964
|
}
|
39963
40965
|
validateSourcePackageMemberConflicts(pkg) {
|
39964
40966
|
let result = this._sourcePackageMemberConflictsDiagnostics.get(pkg);
|
@@ -40236,7 +41238,7 @@ var Type4 = class {
|
|
40236
41238
|
} catch (e) {
|
40237
41239
|
if (e instanceof RecursiveAnalysisError) {
|
40238
41240
|
const diagnostic = this._analyzer.createNodeDiagnostic(
|
40239
|
-
|
41241
|
+
290 /* RecursionOccurredWhileCalculatingTheTypeOfTheExpression */,
|
40240
41242
|
node
|
40241
41243
|
);
|
40242
41244
|
this._analyzer.addDiagnosticComputedLazily(diagnostic);
|
@@ -41633,7 +42635,7 @@ var Entity4 = class {
|
|
41633
42635
|
this._fieldEntities.set(accessor, entity);
|
41634
42636
|
if (accessor.kind === 56 /* FieldSetterDeclaration */) {
|
41635
42637
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
41636
|
-
|
42638
|
+
311 /* WriteFunctionHasNoCorrespondingReadFunction */,
|
41637
42639
|
accessor.name
|
41638
42640
|
));
|
41639
42641
|
}
|
@@ -41671,7 +42673,7 @@ var Entity4 = class {
|
|
41671
42673
|
this._referenceOperatorEntities.set(accessor, entity);
|
41672
42674
|
if (accessor.kind === 51 /* DereferencedVariableSetterDeclaration */) {
|
41673
42675
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
41674
|
-
|
42676
|
+
311 /* WriteFunctionHasNoCorrespondingReadFunction */,
|
41675
42677
|
accessor.caretToken
|
41676
42678
|
));
|
41677
42679
|
}
|
@@ -41711,7 +42713,7 @@ var Entity4 = class {
|
|
41711
42713
|
this._indexerEntities.set(accessor, entity);
|
41712
42714
|
if (accessor.kind === 48 /* IndexedElementSetterDeclaration */) {
|
41713
42715
|
diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
41714
|
-
|
42716
|
+
311 /* WriteFunctionHasNoCorrespondingReadFunction */,
|
41715
42717
|
accessor.parameterClause
|
41716
42718
|
));
|
41717
42719
|
}
|
@@ -42886,8 +43888,8 @@ var OwningPlainObjectModificationCheck = class {
|
|
42886
43888
|
case 78 /* MemberAccessExpression */: {
|
42887
43889
|
const meaning = this._analyzer.resolveMemberAccessExpression(receiver).meaning;
|
42888
43890
|
if (meaning.kind === "instance-field-access") {
|
42889
|
-
const
|
42890
|
-
if (
|
43891
|
+
const fieldType = meaning.field.value.getType();
|
43892
|
+
if (fieldType.kind === "structured" && fieldType.getEntity().isPlainObject()) {
|
42891
43893
|
result = this.checkReceiverModifiesPlainObjectRecursively(receiver.expression);
|
42892
43894
|
}
|
42893
43895
|
}
|
@@ -43328,7 +44330,7 @@ var TypeUtils = class {
|
|
43328
44330
|
const baseTypes = this.getBaseTypesForCommonTypesSearch(constituentTypes[i]);
|
43329
44331
|
for (let j = result.length - 1; j >= 0; j--) {
|
43330
44332
|
if (!baseTypes.some((t) => t.equals(result[j]))) {
|
43331
|
-
|
44333
|
+
ArrayUtils.removeElement(result, j);
|
43332
44334
|
}
|
43333
44335
|
}
|
43334
44336
|
if (result.length === 0) {
|
@@ -43350,7 +44352,7 @@ var TypeUtils = class {
|
|
43350
44352
|
}
|
43351
44353
|
const assignabilityFlags = this._analyzer.getTypeAssignabilityFlags(possiblyDerivedType, possiblyBaseType);
|
43352
44354
|
if ((assignabilityFlags | 1 /* Identity */ & 2 /* DerivedToBase */) !== 0) {
|
43353
|
-
|
44355
|
+
ArrayUtils.removeElement(types, i);
|
43354
44356
|
break;
|
43355
44357
|
}
|
43356
44358
|
}
|
@@ -43368,7 +44370,7 @@ var TypeUtils = class {
|
|
43368
44370
|
}
|
43369
44371
|
const assignabilityFlags = this._analyzer.getTypeAssignabilityFlags(possiblyDerivedType, possiblyBaseType);
|
43370
44372
|
if ((assignabilityFlags | 1 /* Identity */ & 2 /* DerivedToBase */) !== 0) {
|
43371
|
-
|
44373
|
+
ArrayUtils.removeElement(types, i);
|
43372
44374
|
break;
|
43373
44375
|
}
|
43374
44376
|
}
|
@@ -43535,6 +44537,8 @@ var ConflictsCheck = class {
|
|
43535
44537
|
}
|
43536
44538
|
/**
|
43537
44539
|
* Проверяет, конфликтуют две сущности, имеющие параметры, но не имеющие параметры типа.
|
44540
|
+
*
|
44541
|
+
* Отношение "сущности, имеющие только параметры, конфликтуют" является транзитивным.
|
43538
44542
|
*/
|
43539
44543
|
doSignaturesWithoutTypeParametersConflict(entity1, entity2) {
|
43540
44544
|
return this.doParametersConflict(entity1.getValueParameters(), entity2.getValueParameters());
|
@@ -43760,6 +44764,206 @@ var AssignmentChecker = class {
|
|
43760
44764
|
}
|
43761
44765
|
};
|
43762
44766
|
|
44767
|
+
// source/analysis/TypeMemberConflictsValidator.ts
|
44768
|
+
var TypeMemberConflictsValidator = class {
|
44769
|
+
constructor(_analyzer, _members, _diagnostics) {
|
44770
|
+
this._analyzer = _analyzer;
|
44771
|
+
this._members = _members;
|
44772
|
+
this._diagnostics = _diagnostics;
|
44773
|
+
}
|
44774
|
+
validate() {
|
44775
|
+
this.validateNamedMembers(this._members.getNamedMembers());
|
44776
|
+
this.validateConstructors(this._members.getConstructors());
|
44777
|
+
this.validateDestructors(this._members.getDestructors());
|
44778
|
+
this.validateOperators(this._members.getOperators());
|
44779
|
+
this.validateIndexers(this._members.getIndexers());
|
44780
|
+
this.validateDereferenceOperators(this._members.getDereferenceOperators());
|
44781
|
+
}
|
44782
|
+
validateNamedMembers(members) {
|
44783
|
+
this.validateNamedMembersWithoutIsStaticCheck(members.filter((m) => m.isStatic()));
|
44784
|
+
this.validateNamedMembersWithoutIsStaticCheck(members.filter((m) => !m.isStatic()));
|
44785
|
+
}
|
44786
|
+
validateNamedMembersWithoutIsStaticCheck(members) {
|
44787
|
+
const membersByNameKey = Query.from(members).groupByToMap((m) => m.getName().key);
|
44788
|
+
for (const members2 of membersByNameKey.values()) {
|
44789
|
+
if (members2.length <= 1) {
|
44790
|
+
continue;
|
44791
|
+
}
|
44792
|
+
if (members2.every((m) => m.kind === 1 /* Function */)) {
|
44793
|
+
this.validateMethodsWithSameName(members2);
|
44794
|
+
} else {
|
44795
|
+
this.reportNameConflictDiagnosticsForAllEntities(
|
44796
|
+
members2,
|
44797
|
+
301 /* TypeAlreadyContainsDeclarationWithTheSameName */
|
44798
|
+
);
|
44799
|
+
}
|
44800
|
+
}
|
44801
|
+
}
|
44802
|
+
validateMethodsWithSameName(members) {
|
44803
|
+
for (const entity of members) {
|
44804
|
+
for (const memberToCheckAgainst of members) {
|
44805
|
+
if (memberToCheckAgainst === entity) {
|
44806
|
+
continue;
|
44807
|
+
}
|
44808
|
+
if (this._analyzer.conflictsCheck.doFunctionSignaturesConflict(entity, memberToCheckAgainst)) {
|
44809
|
+
this.reportNameConflictDiagnostic(
|
44810
|
+
entity,
|
44811
|
+
302 /* TypeAlreadyContainsMethodWithTheSameNameAndParameterTypes */
|
44812
|
+
);
|
44813
|
+
break;
|
44814
|
+
}
|
44815
|
+
}
|
44816
|
+
}
|
44817
|
+
}
|
44818
|
+
validateConstructors(members) {
|
44819
|
+
this.validateMembersWithoutTypeParametersInSignature(
|
44820
|
+
members,
|
44821
|
+
303 /* TypeAlreadyContainsConstructorWithTheSameParameterTypes */
|
44822
|
+
);
|
44823
|
+
}
|
44824
|
+
validateDestructors(members) {
|
44825
|
+
if (members.length > 1) {
|
44826
|
+
this.reportNameConflictDiagnosticsForAllEntities(members, 306 /* TypeCanHaveOnlyOneDestructor */);
|
44827
|
+
}
|
44828
|
+
}
|
44829
|
+
validateOperators(members) {
|
44830
|
+
const operatorsByKind = Query.from(members).groupByToMap((m) => m.getOperatorKind());
|
44831
|
+
for (const operators of operatorsByKind.values()) {
|
44832
|
+
this.validateMembersWithoutTypeParametersInSignature(
|
44833
|
+
operators,
|
44834
|
+
304 /* TypeAlreadyContainsOperatorFunctionWithTheSameParameterTypes */
|
44835
|
+
);
|
44836
|
+
}
|
44837
|
+
}
|
44838
|
+
validateIndexers(members) {
|
44839
|
+
this.validateMembersWithoutTypeParametersInSignature(
|
44840
|
+
members.filter((m) => !m.isStatic()),
|
44841
|
+
305 /* TypeAlreadyContainsIndexerWithTheSameParameterTypes */
|
44842
|
+
);
|
44843
|
+
this.validateMembersWithoutTypeParametersInSignature(
|
44844
|
+
members.filter((m) => m.isStatic()),
|
44845
|
+
305 /* TypeAlreadyContainsIndexerWithTheSameParameterTypes */
|
44846
|
+
);
|
44847
|
+
}
|
44848
|
+
validateDereferenceOperators(members) {
|
44849
|
+
const instanceDereferenceOperators = members.filter((m) => !m.isStatic());
|
44850
|
+
if (instanceDereferenceOperators.length > 1) {
|
44851
|
+
this.reportNameConflictDiagnosticsForAllEntities(
|
44852
|
+
instanceDereferenceOperators,
|
44853
|
+
307 /* TypeCanHaveOnlyOneDereferenceOperator */
|
44854
|
+
);
|
44855
|
+
}
|
44856
|
+
const staticDereferenceOperators = members.filter((m) => m.isStatic());
|
44857
|
+
if (staticDereferenceOperators.length > 1) {
|
44858
|
+
this.reportNameConflictDiagnosticsForAllEntities(
|
44859
|
+
staticDereferenceOperators,
|
44860
|
+
307 /* TypeCanHaveOnlyOneDereferenceOperator */
|
44861
|
+
);
|
44862
|
+
}
|
44863
|
+
}
|
44864
|
+
validateMembersWithoutTypeParametersInSignature(members, diagnosticCode) {
|
44865
|
+
if (members.length <= 1) {
|
44866
|
+
return;
|
44867
|
+
}
|
44868
|
+
const mutableMemberArray = Array.from(members);
|
44869
|
+
let startIndex = mutableMemberArray.length - 1;
|
44870
|
+
while (startIndex >= 1) {
|
44871
|
+
const member = mutableMemberArray[startIndex];
|
44872
|
+
let isConflictReportedForFirstMember = false;
|
44873
|
+
for (let j = startIndex - 1; j >= 0; j--) {
|
44874
|
+
const memberToCheckAgainst = mutableMemberArray[j];
|
44875
|
+
if (this._analyzer.conflictsCheck.doSignaturesWithoutTypeParametersConflict(member, memberToCheckAgainst)) {
|
44876
|
+
if (!isConflictReportedForFirstMember) {
|
44877
|
+
this.reportNameConflictDiagnostic(member, diagnosticCode);
|
44878
|
+
isConflictReportedForFirstMember = true;
|
44879
|
+
}
|
44880
|
+
this.reportNameConflictDiagnostic(memberToCheckAgainst, diagnosticCode);
|
44881
|
+
ArrayUtils.removeElement(mutableMemberArray, j);
|
44882
|
+
startIndex--;
|
44883
|
+
}
|
44884
|
+
}
|
44885
|
+
startIndex--;
|
44886
|
+
}
|
44887
|
+
}
|
44888
|
+
reportNameConflictDiagnosticsForAllEntities(entities, diagnosticCode) {
|
44889
|
+
for (const entity of entities) {
|
44890
|
+
this.reportNameConflictDiagnostic(entity, diagnosticCode);
|
44891
|
+
}
|
44892
|
+
}
|
44893
|
+
reportNameConflictDiagnostic(entity, code) {
|
44894
|
+
const diagnosticLocation = this.getDiagnosticLocation(entity);
|
44895
|
+
if (diagnosticLocation !== void 0) {
|
44896
|
+
const diagnosticData = DiagnosticData.withCode(code);
|
44897
|
+
this._diagnostics.addDiagnostic(new Diagnostic(diagnosticData, diagnosticLocation));
|
44898
|
+
}
|
44899
|
+
}
|
44900
|
+
getDiagnosticLocation(entity) {
|
44901
|
+
switch (entity.kind) {
|
44902
|
+
case 0 /* Variable */: {
|
44903
|
+
const definition = entity.getDefinition();
|
44904
|
+
if (definition.kind !== 0 /* Source */) {
|
44905
|
+
return void 0;
|
44906
|
+
}
|
44907
|
+
const node = definition.value.kind === "single" ? definition.value.node.name : definition.value.nodes[0]?.name;
|
44908
|
+
if (node === void 0) {
|
44909
|
+
return void 0;
|
44910
|
+
}
|
44911
|
+
return this._analyzer.createNodeDiagnosticLocation(node);
|
44912
|
+
}
|
44913
|
+
case 1 /* Function */: {
|
44914
|
+
const definition = entity.getDefinition();
|
44915
|
+
if (definition.kind !== 0 /* Source */) {
|
44916
|
+
return void 0;
|
44917
|
+
}
|
44918
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.node.name);
|
44919
|
+
}
|
44920
|
+
case 5 /* Indexer */: {
|
44921
|
+
const definition = entity.getDefinition();
|
44922
|
+
if (definition.kind !== 0 /* Source */) {
|
44923
|
+
return void 0;
|
44924
|
+
}
|
44925
|
+
if (definition.nodes.length <= 0) {
|
44926
|
+
return void 0;
|
44927
|
+
}
|
44928
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.nodes[0].parameterClause);
|
44929
|
+
}
|
44930
|
+
case 6 /* DereferenceOperator */: {
|
44931
|
+
const definition = entity.getDefinition();
|
44932
|
+
if (definition.kind !== 0 /* Source */) {
|
44933
|
+
return void 0;
|
44934
|
+
}
|
44935
|
+
if (definition.nodes.length <= 0) {
|
44936
|
+
return void 0;
|
44937
|
+
}
|
44938
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.nodes[0].caretToken);
|
44939
|
+
}
|
44940
|
+
case 7 /* Constructor */: {
|
44941
|
+
const definition = entity.getDefinition();
|
44942
|
+
if (definition.kind !== 0 /* Source */) {
|
44943
|
+
return void 0;
|
44944
|
+
}
|
44945
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.node.creationKeyword);
|
44946
|
+
}
|
44947
|
+
case 8 /* Destructor */: {
|
44948
|
+
const definition = entity.getDefinition();
|
44949
|
+
if (definition.kind !== 0 /* Source */) {
|
44950
|
+
return void 0;
|
44951
|
+
}
|
44952
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.node.destructionKeyword);
|
44953
|
+
}
|
44954
|
+
case 9 /* Operator */: {
|
44955
|
+
const definition = entity.getDefinition();
|
44956
|
+
if (definition.kind !== 0 /* Source */) {
|
44957
|
+
return void 0;
|
44958
|
+
}
|
44959
|
+
return this._analyzer.createNodeDiagnosticLocation(definition.node.name);
|
44960
|
+
}
|
44961
|
+
default:
|
44962
|
+
Debug.never(entity);
|
44963
|
+
}
|
44964
|
+
}
|
44965
|
+
};
|
44966
|
+
|
43763
44967
|
// source/analysis/DiagnosticCollector.ts
|
43764
44968
|
var DiagnosticCollector = class _DiagnosticCollector {
|
43765
44969
|
constructor(analyzer, sourceFile, cancellationToken) {
|
@@ -43774,6 +44978,12 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
43774
44978
|
analyzer.createLocalizationContext(sourceFile),
|
43775
44979
|
sourceFile.package.dialect ?? 0 /* Mixed */
|
43776
44980
|
);
|
44981
|
+
this._modifierValidator = new ModifierValidator(
|
44982
|
+
analyzer,
|
44983
|
+
this._diagnosticAcceptor,
|
44984
|
+
sourceFile.package.locale,
|
44985
|
+
sourceFile.package.dialect
|
44986
|
+
);
|
43777
44987
|
}
|
43778
44988
|
static {
|
43779
44989
|
this.CancellationTokenThrottleTime = 50;
|
@@ -43800,6 +45010,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
43800
45010
|
this._sourceFile.getSyntaxNode(),
|
43801
45011
|
this._cancellationToken
|
43802
45012
|
);
|
45013
|
+
this._modifierValidator.validateTopLevelPackageMembers(this._sourceFile.getSyntaxNode().declarationList);
|
43803
45014
|
if (this._sourceFile.package.kind === "program") {
|
43804
45015
|
const memberConflictDiagnostics = this._analyzer.validateSourcePackageMemberConflicts(this._sourceFile.package).filter((d) => d.location?.file === this._sourceFile);
|
43805
45016
|
this.addDiagnostics(memberConflictDiagnostics);
|
@@ -43815,7 +45026,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
43815
45026
|
);
|
43816
45027
|
const unreachableCodeDiagnostics = this._analyzer.getControlFlowGraph(this._sourceFile).unreachableCodeDiagnostics;
|
43817
45028
|
this.addDiagnostics(unreachableCodeDiagnostics);
|
43818
|
-
const diagnosticsComputedLazily = this._analyzer.
|
45029
|
+
const diagnosticsComputedLazily = this._analyzer.getSourceFileDiagnosticsComputedLazily(this._sourceFile);
|
43819
45030
|
this.addDiagnostics(diagnosticsComputedLazily);
|
43820
45031
|
PerformanceMeasurement.markEnd();
|
43821
45032
|
return this._diagnostics;
|
@@ -43969,12 +45180,15 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
43969
45180
|
if (node.typeParameterClause !== void 0) {
|
43970
45181
|
this._analyzer.semanticContext.ofTypeDeclarationTypeParameters(node, node.typeParameterClause).validateNameConflicts(this._diagnosticAcceptor);
|
43971
45182
|
}
|
45183
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
43972
45184
|
break;
|
43973
45185
|
}
|
43974
45186
|
case 38 /* PackageVariantTypeDeclaration */: {
|
43975
45187
|
if (node.typeParameterClause !== void 0) {
|
43976
45188
|
this._analyzer.semanticContext.ofTypeDeclarationTypeParameters(node, node.typeParameterClause).validateNameConflicts(this._diagnosticAcceptor);
|
43977
45189
|
}
|
45190
|
+
const entity = this._analyzer.entity.ofPackageVariantTypeDeclaration(node);
|
45191
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
43978
45192
|
break;
|
43979
45193
|
}
|
43980
45194
|
case 32 /* TypeMemberDeclarationBlock */: {
|
@@ -44163,6 +45377,12 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44163
45377
|
break;
|
44164
45378
|
}
|
44165
45379
|
case 39 /* VariantTypeDeclarationBody */: {
|
45380
|
+
this._modifierValidator.validateTopLevelTypeMembers(
|
45381
|
+
node.memberBlock.memberList,
|
45382
|
+
3 /* VariantType */,
|
45383
|
+
false,
|
45384
|
+
false
|
45385
|
+
);
|
44166
45386
|
const underlyingType = this._analyzer.entity.ofVariantTypeDeclaration(node.parent).getUnderlyingType();
|
44167
45387
|
const isIntegerVariant = underlyingType.equals(this._analyzer.standardTypes.integer);
|
44168
45388
|
for (const member of node.memberBlock.memberList.members) {
|
@@ -44179,10 +45399,18 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44179
45399
|
break;
|
44180
45400
|
}
|
44181
45401
|
case 40 /* TypeExtensionDeclaration */: {
|
45402
|
+
const entity = this._analyzer.entity.ofTypeExtensionDeclaration(node);
|
44182
45403
|
const extendedType = this._analyzer.getExtendedType(node);
|
44183
45404
|
if (extendedType.kind === "error") {
|
44184
45405
|
this.addMaybeLazyDiagnostics(extendedType.value);
|
44185
45406
|
}
|
45407
|
+
this._modifierValidator.validateTopLevelTypeMembers(
|
45408
|
+
node.memberBlock.memberList,
|
45409
|
+
5 /* TypeExtension */,
|
45410
|
+
false,
|
45411
|
+
false
|
45412
|
+
);
|
45413
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
44186
45414
|
break;
|
44187
45415
|
}
|
44188
45416
|
case 86 /* ObjectExpression */: {
|
@@ -44222,6 +45450,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44222
45450
|
if (node.typeParameterClause !== void 0) {
|
44223
45451
|
this._analyzer.semanticContext.ofTypeDeclarationTypeParameters(node, node.typeParameterClause).validateNameConflicts(this._diagnosticAcceptor);
|
44224
45452
|
}
|
45453
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
44225
45454
|
break;
|
44226
45455
|
}
|
44227
45456
|
case 143 /* TypeParameterDeclaration */: {
|
@@ -44279,6 +45508,51 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44279
45508
|
this._analyzer.semanticContext.ofFunctionTypeDeclarationParameters(node).validateNameConflicts(this._diagnosticAcceptor);
|
44280
45509
|
break;
|
44281
45510
|
}
|
45511
|
+
case 18 /* AnonymousStructuredTypeDeclaration */: {
|
45512
|
+
const entity = this._analyzer.entity.ofAnonymousStructuredTypeDeclaration(node);
|
45513
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
45514
|
+
break;
|
45515
|
+
}
|
45516
|
+
case 19 /* AnonymousVariantTypeDeclaration */: {
|
45517
|
+
const entity = this._analyzer.entity.ofAnonymousVariantTypeDeclaration(node);
|
45518
|
+
new TypeMemberConflictsValidator(this._analyzer, entity.getMembers(), this._diagnosticAcceptor).validate();
|
45519
|
+
break;
|
45520
|
+
}
|
45521
|
+
case 34 /* StructuredTypeDeclarationBody */: {
|
45522
|
+
let declarationKind;
|
45523
|
+
switch (node.structuredTypeKindKeyword.keywordKind) {
|
45524
|
+
case 3 /* Aspect */:
|
45525
|
+
declarationKind = 2 /* AspectType */;
|
45526
|
+
break;
|
45527
|
+
case 4 /* Object */:
|
45528
|
+
declarationKind = 0 /* ObjectType */;
|
45529
|
+
break;
|
45530
|
+
case 5 /* PlainObject */:
|
45531
|
+
declarationKind = 1 /* PlainObjectType */;
|
45532
|
+
break;
|
45533
|
+
default:
|
45534
|
+
Debug.never(node.structuredTypeKindKeyword);
|
45535
|
+
}
|
45536
|
+
const entity = this._analyzer.entity.ofStructuredTypeDeclaration(node.parent);
|
45537
|
+
this._modifierValidator.validateTopLevelTypeMembers(
|
45538
|
+
node.memberBlock.memberList,
|
45539
|
+
declarationKind,
|
45540
|
+
entity.isAbstract(),
|
45541
|
+
entity.markedBasic()
|
45542
|
+
);
|
45543
|
+
break;
|
45544
|
+
}
|
45545
|
+
case 23 /* AliasTypeDeclarationBody */: {
|
45546
|
+
if (node.memberBlock?.memberList !== void 0) {
|
45547
|
+
this._modifierValidator.validateTopLevelTypeMembers(
|
45548
|
+
node.memberBlock.memberList,
|
45549
|
+
4 /* AliasType */,
|
45550
|
+
false,
|
45551
|
+
false
|
45552
|
+
);
|
45553
|
+
}
|
45554
|
+
break;
|
45555
|
+
}
|
44282
45556
|
}
|
44283
45557
|
}
|
44284
45558
|
checkFunctionLiteral(node) {
|
@@ -44303,7 +45577,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44303
45577
|
case "resolved": {
|
44304
45578
|
const receiverType = this._analyzer.type.ofExpression(node.expression);
|
44305
45579
|
if (this._analyzer.canTypeBeNone(receiverType)) {
|
44306
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45580
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(287 /* ExpressionCanBeNone */, node.expression));
|
44307
45581
|
}
|
44308
45582
|
break;
|
44309
45583
|
}
|
@@ -44328,7 +45602,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44328
45602
|
if (meaning.kind !== "unresolved") {
|
44329
45603
|
const receiverType = this._analyzer.type.ofExpression(node.expression);
|
44330
45604
|
if (this._analyzer.canTypeBeNone(receiverType)) {
|
44331
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45605
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(287 /* ExpressionCanBeNone */, node.expression));
|
44332
45606
|
}
|
44333
45607
|
}
|
44334
45608
|
}
|
@@ -44362,7 +45636,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44362
45636
|
const containingSubprogram = this._analyzer.semanticContext.containing(node).getContainingSubprogram();
|
44363
45637
|
if (containingSubprogram?.allowsAsyncCalls() !== true) {
|
44364
45638
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44365
|
-
|
45639
|
+
283 /* AsyncFunctionCanOnlyBeCalledFromFunctionMarkedWithAsyncModifier */,
|
44366
45640
|
node
|
44367
45641
|
));
|
44368
45642
|
}
|
@@ -44370,7 +45644,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44370
45644
|
if (meaning.kind === "object-function-call") {
|
44371
45645
|
const calleeType = this._analyzer.type.ofExpression(node.expression);
|
44372
45646
|
if (this._analyzer.canTypeBeNone(calleeType)) {
|
44373
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45647
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(287 /* ExpressionCanBeNone */, node.expression));
|
44374
45648
|
}
|
44375
45649
|
}
|
44376
45650
|
}
|
@@ -44486,6 +45760,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44486
45760
|
}
|
44487
45761
|
checkPackageVariableGetterDeclaration(node) {
|
44488
45762
|
const entity = this._analyzer.entity.ofComputedPackageVariableDeclaration(node);
|
45763
|
+
entity.ensureAllDiagnosticsReported?.();
|
44489
45764
|
this.checkPackageMemberBodyPresence(entity, node.block, node.name);
|
44490
45765
|
this.checkAllCodePathsReturnOrResultVariableIsAssigned(
|
44491
45766
|
node,
|
@@ -44501,20 +45776,6 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44501
45776
|
checkConstructorDeclaration(node) {
|
44502
45777
|
const entity = this._analyzer.entity.ofConstructorDeclaration(node);
|
44503
45778
|
this.checkTypeMemberBodyPresence(entity, node.block, node.creationKeyword);
|
44504
|
-
const basicModifier = findModifier(node, 17 /* Basic */);
|
44505
|
-
if (basicModifier !== void 0) {
|
44506
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44507
|
-
284 /* ConstructorCannotBeDeclaredAsBasic */,
|
44508
|
-
node.creationKeyword
|
44509
|
-
));
|
44510
|
-
}
|
44511
|
-
const overrideModifier = findModifier(node, 39 /* Override */);
|
44512
|
-
if (overrideModifier !== void 0) {
|
44513
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44514
|
-
285 /* ConstructorCannotBeDeclaredAsOverridden */,
|
44515
|
-
node.creationKeyword
|
44516
|
-
));
|
44517
|
-
}
|
44518
45779
|
this._analyzer.semanticContext.ofConstructorDeclarationParameters(node).validateNameConflicts(this._diagnosticAcceptor);
|
44519
45780
|
}
|
44520
45781
|
checkMethodDeclaration(node) {
|
@@ -44530,7 +45791,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44530
45791
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44531
45792
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44532
45793
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44533
|
-
|
45794
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44534
45795
|
overrideModifier
|
44535
45796
|
));
|
44536
45797
|
}
|
@@ -44553,17 +45814,10 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44553
45814
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44554
45815
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44555
45816
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44556
|
-
|
45817
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44557
45818
|
overrideModifier
|
44558
45819
|
));
|
44559
45820
|
}
|
44560
|
-
const staticModifier = findModifier(node, 41 /* Static */);
|
44561
|
-
if (staticModifier !== void 0) {
|
44562
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44563
|
-
279 /* OperatorFunctionMustNotBeStatic */,
|
44564
|
-
staticModifier
|
44565
|
-
));
|
44566
|
-
}
|
44567
45821
|
this._analyzer.semanticContext.ofOperatorDeclarationParameters(node).validateNameConflicts(this._diagnosticAcceptor);
|
44568
45822
|
const requiredParameterCount = requiredParameterCountBySyntacticalOperatorKind[node.operatorKind];
|
44569
45823
|
const actualParameterCount = node.parameterClause.parameterList.parameters.count();
|
@@ -44576,7 +45830,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44576
45830
|
this._sourceFile.package.dialect
|
44577
45831
|
);
|
44578
45832
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44579
|
-
|
45833
|
+
279 /* OperatorFunction0MustNotHaveParameters */,
|
44580
45834
|
node.name,
|
44581
45835
|
[operatorText]
|
44582
45836
|
));
|
@@ -44591,7 +45845,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44591
45845
|
this._sourceFile.package.dialect
|
44592
45846
|
);
|
44593
45847
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44594
|
-
|
45848
|
+
281 /* OperatorFunction0MustHaveNoMoreThanOneParameter */,
|
44595
45849
|
node.name,
|
44596
45850
|
[operatorText]
|
44597
45851
|
));
|
@@ -44606,7 +45860,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44606
45860
|
this._sourceFile.package.dialect
|
44607
45861
|
);
|
44608
45862
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44609
|
-
|
45863
|
+
280 /* OperatorFunction0MustHaveOneParameter */,
|
44610
45864
|
node.name,
|
44611
45865
|
[operatorText]
|
44612
45866
|
));
|
@@ -44644,18 +45898,19 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44644
45898
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44645
45899
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44646
45900
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44647
|
-
|
45901
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44648
45902
|
overrideModifier
|
44649
45903
|
));
|
44650
45904
|
}
|
44651
45905
|
}
|
44652
45906
|
checkFieldGetterDeclaration(node) {
|
44653
45907
|
const entity = this._analyzer.entity.ofComputedFieldDeclaration(node);
|
45908
|
+
entity.ensureAllDiagnosticsReported?.();
|
44654
45909
|
this.checkTypeMemberBodyPresence(entity, node.block, node.name);
|
44655
45910
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44656
45911
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44657
45912
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44658
|
-
|
45913
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44659
45914
|
overrideModifier
|
44660
45915
|
));
|
44661
45916
|
}
|
@@ -44672,18 +45927,19 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44672
45927
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44673
45928
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44674
45929
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44675
|
-
|
45930
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44676
45931
|
overrideModifier
|
44677
45932
|
));
|
44678
45933
|
}
|
44679
45934
|
}
|
44680
45935
|
checkIndexedElementGetterDeclaration(node) {
|
44681
45936
|
const entity = this._analyzer.entity.ofIndexerDeclaration(node);
|
45937
|
+
entity.ensureAllDiagnosticsReported?.();
|
44682
45938
|
this.checkTypeMemberBodyPresence(entity, node.block, node.parameterClause);
|
44683
45939
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44684
45940
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44685
45941
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44686
|
-
|
45942
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44687
45943
|
overrideModifier
|
44688
45944
|
));
|
44689
45945
|
}
|
@@ -44701,7 +45957,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44701
45957
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44702
45958
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44703
45959
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44704
|
-
|
45960
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44705
45961
|
overrideModifier
|
44706
45962
|
));
|
44707
45963
|
}
|
@@ -44709,11 +45965,12 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44709
45965
|
}
|
44710
45966
|
checkDereferencedVariableGetterDeclaration(node) {
|
44711
45967
|
const entity = this._analyzer.entity.ofDereferenceOperatorDeclaration(node);
|
45968
|
+
entity.ensureAllDiagnosticsReported?.();
|
44712
45969
|
this.checkTypeMemberBodyPresence(entity, node.block, node.caretToken);
|
44713
45970
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44714
45971
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44715
45972
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44716
|
-
|
45973
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44717
45974
|
overrideModifier
|
44718
45975
|
));
|
44719
45976
|
}
|
@@ -44730,7 +45987,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44730
45987
|
const overrideModifier = findModifier(node, 39 /* Override */);
|
44731
45988
|
if (overrideModifier !== void 0 && entity.getOverriddenMembers().length === 0) {
|
44732
45989
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
44733
|
-
|
45990
|
+
282 /* CorrespondingBasicTypeMemberNotFound */,
|
44734
45991
|
overrideModifier
|
44735
45992
|
));
|
44736
45993
|
}
|
@@ -44892,8 +46149,9 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44892
46149
|
break;
|
44893
46150
|
}
|
44894
46151
|
case 4 /* RequiresBecauseIsBasicAspectTypeMember */:
|
44895
|
-
case
|
44896
|
-
case
|
46152
|
+
case 5 /* RequiresBecauseIsHiddenAspectTypeMember */:
|
46153
|
+
case 7 /* RequiresBecauseIsRegularMember */:
|
46154
|
+
case 6 /* RequiresBecauseIsStaticMember */:
|
44897
46155
|
if (body === void 0) {
|
44898
46156
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
44899
46157
|
}
|
@@ -44910,19 +46168,22 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
44910
46168
|
return 3 /* DoesNotRequireBecauseHasBuiltIntoPlatformTag */;
|
44911
46169
|
}
|
44912
46170
|
if (TypeMemberEntity.isStatic(entity)) {
|
44913
|
-
return
|
46171
|
+
return 6 /* RequiresBecauseIsStaticMember */;
|
44914
46172
|
}
|
44915
46173
|
if (entity.markedAbstract()) {
|
44916
46174
|
return 1 /* DoesNotRequireBecauseIsAbstract */;
|
44917
46175
|
}
|
44918
46176
|
const isAspectTypeMember = TypeMemberEntity.isAspectTypeMember(entity);
|
44919
|
-
if (TypeMemberEntity.markedBasic(entity)
|
46177
|
+
if (isAspectTypeMember && TypeMemberEntity.markedBasic(entity)) {
|
44920
46178
|
return 4 /* RequiresBecauseIsBasicAspectTypeMember */;
|
44921
46179
|
}
|
46180
|
+
if (isAspectTypeMember && entity.isHidden()?.kind === "type") {
|
46181
|
+
return 5 /* RequiresBecauseIsHiddenAspectTypeMember */;
|
46182
|
+
}
|
44922
46183
|
if (isAspectTypeMember) {
|
44923
46184
|
return 2 /* DoesNotRequireBecauseIsAspectTypeMember */;
|
44924
46185
|
}
|
44925
|
-
return
|
46186
|
+
return 7 /* RequiresBecauseIsRegularMember */;
|
44926
46187
|
}
|
44927
46188
|
// TODO: учесть константы времени компиляции.
|
44928
46189
|
// private validateVariantInitializer(expression: tree.Expression): void {
|
@@ -45004,12 +46265,12 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45004
46265
|
if (entity.subkind === "local") {
|
45005
46266
|
if (this.checkLocalVariableUsedBeforeDeclaration(node, entity)) {
|
45006
46267
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45007
|
-
|
46268
|
+
308 /* VariableIsUsedBeforeItsDeclaration */,
|
45008
46269
|
node
|
45009
46270
|
));
|
45010
46271
|
} else if ((meaning.accessKind === 0 /* Get */ || meaning.accessKind === 2 /* GetSet */) && this.checkLocalVariableIsUsedBeforeBeingAssigned(node, entity)) {
|
45011
46272
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45012
|
-
|
46273
|
+
309 /* VariableMayNotHasBeenAssignedBeforeUsage */,
|
45013
46274
|
node
|
45014
46275
|
));
|
45015
46276
|
}
|
@@ -45137,7 +46398,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45137
46398
|
if (meaning.kind === "instance-field-access" || meaning.kind === "instance-method-access" || meaning.kind === "operator-access") {
|
45138
46399
|
const receiverType = this._analyzer.type.ofExpression(node.expression);
|
45139
46400
|
if (this._analyzer.canTypeBeNone(receiverType)) {
|
45140
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46401
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(287 /* ExpressionCanBeNone */, node.expression));
|
45141
46402
|
}
|
45142
46403
|
}
|
45143
46404
|
}
|
@@ -45219,17 +46480,17 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45219
46480
|
const meaning = this._analyzer.resolveMemberAccessExpression(node).meaning;
|
45220
46481
|
switch (meaning.kind) {
|
45221
46482
|
case "package-variable-access": {
|
45222
|
-
this.checkAssignmentToPackageVariable(meaning.variable.value, statement, node.
|
46483
|
+
this.checkAssignmentToPackageVariable(meaning.variable.value, statement, node.memberName);
|
45223
46484
|
this.checkOptionalChainingIsUsedOnTheLeftSideOfAssignment(statement.left);
|
45224
46485
|
break;
|
45225
46486
|
}
|
45226
46487
|
case "static-field-access": {
|
45227
|
-
this.checkAssignmentToField(meaning.field.value.getEntity(), statement, node.
|
46488
|
+
this.checkAssignmentToField(meaning.field.value.getEntity(), statement, node.memberName, node);
|
45228
46489
|
this.checkOptionalChainingIsUsedOnTheLeftSideOfAssignment(statement.left);
|
45229
46490
|
break;
|
45230
46491
|
}
|
45231
46492
|
case "instance-field-access": {
|
45232
|
-
this.checkAssignmentToField(meaning.field.value.getEntity(), statement, node.
|
46493
|
+
this.checkAssignmentToField(meaning.field.value.getEntity(), statement, node.memberName, node);
|
45233
46494
|
this.checkOptionalChainingIsUsedOnTheLeftSideOfAssignment(statement.left);
|
45234
46495
|
break;
|
45235
46496
|
}
|
@@ -45239,7 +46500,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45239
46500
|
case "operator-access": {
|
45240
46501
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45241
46502
|
229 /* CannotAssignValueToExpression */,
|
45242
|
-
node.
|
46503
|
+
node.memberName
|
45243
46504
|
));
|
45244
46505
|
break;
|
45245
46506
|
}
|
@@ -45307,7 +46568,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45307
46568
|
}
|
45308
46569
|
}
|
45309
46570
|
}
|
45310
|
-
checkAssignmentToField(entity, assignmentNode, nodeForDiagnostic,
|
46571
|
+
checkAssignmentToField(entity, assignmentNode, nodeForDiagnostic, ifMemberAccessThenNode) {
|
45311
46572
|
if (entity.isConstant()) {
|
45312
46573
|
const semanticContext = this._analyzer.semanticContext.containing(assignmentNode);
|
45313
46574
|
const containingSubprogram = semanticContext.getContainingSubprogram();
|
@@ -45327,7 +46588,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45327
46588
|
nodeForDiagnostic
|
45328
46589
|
));
|
45329
46590
|
} else {
|
45330
|
-
const isAssignedToAnotherInstance =
|
46591
|
+
const isAssignedToAnotherInstance = ifMemberAccessThenNode !== void 0 && unwrapParenthesizedExpressions(ifMemberAccessThenNode.expression).kind !== 86 /* ObjectExpression */;
|
45331
46592
|
if (isAssignedToAnotherInstance) {
|
45332
46593
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45333
46594
|
229 /* CannotAssignValueToExpression */,
|
@@ -45430,7 +46691,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45430
46691
|
checkOptionalChainingIsUsedOnTheLeftSideOfAssignment(left) {
|
45431
46692
|
if (this._analyzer.isExpressionOptionalChainingSyntactically(left)) {
|
45432
46693
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45433
|
-
|
46694
|
+
288 /* TargetVariableExpressionInTheAssignmentStatementCannotContainQuestionOperator */,
|
45434
46695
|
left
|
45435
46696
|
));
|
45436
46697
|
}
|
@@ -45605,7 +46866,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
45605
46866
|
}
|
45606
46867
|
if (shouldReportError) {
|
45607
46868
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
45608
|
-
|
46869
|
+
310 /* NotAllCodePathsReturnAValueAndResultLocalVariableMayNotHasBeenAssigned */,
|
45609
46870
|
nodeForDiagnostic
|
45610
46871
|
));
|
45611
46872
|
}
|
@@ -45656,98 +46917,6 @@ var requiredParameterCountBySyntacticalOperatorKind = {
|
|
45656
46917
|
[16 /* BitwiseXor */]: 2 /* One */
|
45657
46918
|
};
|
45658
46919
|
|
45659
|
-
// source/analysis/FindModifier.ts
|
45660
|
-
function findModifier(node, modifierKeywordKind) {
|
45661
|
-
for (const modifier of node.modifierList.modifiers) {
|
45662
|
-
if (modifier.value.keywordKind === modifierKeywordKind) {
|
45663
|
-
return modifier;
|
45664
|
-
}
|
45665
|
-
}
|
45666
|
-
if (node.parent.kind === 2 /* PackageMemberDeclarationList */) {
|
45667
|
-
let parent = node.parent.parent;
|
45668
|
-
while (parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
45669
|
-
for (const modifier of parent.modifierList.modifiers) {
|
45670
|
-
if (modifier.value.keywordKind === modifierKeywordKind) {
|
45671
|
-
return modifier;
|
45672
|
-
}
|
45673
|
-
}
|
45674
|
-
parent = parent.parent.parent;
|
45675
|
-
}
|
45676
|
-
} else if (node.parent.kind === 31 /* TypeMemberDeclarationList */) {
|
45677
|
-
let parent = node.parent.parent.parent;
|
45678
|
-
while (parent.kind === 44 /* TypeMemberGroupDeclaration */) {
|
45679
|
-
for (const modifier of parent.modifierList.modifiers) {
|
45680
|
-
if (modifier.value.keywordKind === modifierKeywordKind) {
|
45681
|
-
return modifier;
|
45682
|
-
}
|
45683
|
-
}
|
45684
|
-
parent = parent.parent.parent.parent;
|
45685
|
-
}
|
45686
|
-
} else {
|
45687
|
-
Debug.never(node.parent);
|
45688
|
-
}
|
45689
|
-
return void 0;
|
45690
|
-
}
|
45691
|
-
function createDeclaredModifierFlags(node) {
|
45692
|
-
let result = 0 /* None */;
|
45693
|
-
for (const modifier of node.modifierList.modifiers) {
|
45694
|
-
result |= modifierToModifierFlag(modifier);
|
45695
|
-
}
|
45696
|
-
if (node.parent.kind === 2 /* PackageMemberDeclarationList */) {
|
45697
|
-
let parent = node.parent.parent;
|
45698
|
-
while (parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
45699
|
-
for (const modifier of parent.modifierList.modifiers) {
|
45700
|
-
result |= modifierToModifierFlag(modifier);
|
45701
|
-
}
|
45702
|
-
parent = parent.parent.parent;
|
45703
|
-
}
|
45704
|
-
} else if (node.parent.kind === 31 /* TypeMemberDeclarationList */) {
|
45705
|
-
let parent = node.parent.parent.parent;
|
45706
|
-
while (parent.kind === 44 /* TypeMemberGroupDeclaration */) {
|
45707
|
-
for (const modifier of parent.modifierList.modifiers) {
|
45708
|
-
result |= modifierToModifierFlag(modifier);
|
45709
|
-
}
|
45710
|
-
parent = parent.parent.parent.parent;
|
45711
|
-
}
|
45712
|
-
} else {
|
45713
|
-
Debug.never(node.parent);
|
45714
|
-
}
|
45715
|
-
return result;
|
45716
|
-
}
|
45717
|
-
function modifierToModifierFlag(modifier) {
|
45718
|
-
switch (modifier.value.keywordKind) {
|
45719
|
-
case 37 /* Hidden */:
|
45720
|
-
switch (modifier.level?.keywordKind) {
|
45721
|
-
case void 0:
|
45722
|
-
return 1 /* HiddenWithoutLevel */;
|
45723
|
-
case 48 /* InHierarchy */:
|
45724
|
-
return 4 /* HiddenInHierarchy */;
|
45725
|
-
case 49 /* InFile */:
|
45726
|
-
return 8 /* HiddenInFile */;
|
45727
|
-
case 50 /* InPackage */:
|
45728
|
-
return 16 /* HiddenInPackage */;
|
45729
|
-
case 51 /* InType */:
|
45730
|
-
return 2 /* HiddenInType */;
|
45731
|
-
default:
|
45732
|
-
Debug.never(modifier.level);
|
45733
|
-
}
|
45734
|
-
case 17 /* Basic */:
|
45735
|
-
return 32 /* Basic */;
|
45736
|
-
case 36 /* Const */:
|
45737
|
-
return 1024 /* Const */;
|
45738
|
-
case 38 /* Abstract */:
|
45739
|
-
return 128 /* Abstract */;
|
45740
|
-
case 39 /* Override */:
|
45741
|
-
return 256 /* Override */;
|
45742
|
-
case 40 /* Async */:
|
45743
|
-
return 512 /* Async */;
|
45744
|
-
case 41 /* Static */:
|
45745
|
-
return 64 /* Static */;
|
45746
|
-
default:
|
45747
|
-
Debug.never(modifier.value.keywordKind);
|
45748
|
-
}
|
45749
|
-
}
|
45750
|
-
|
45751
46920
|
// source/analysis/SourcePackageDependencyGraph.ts
|
45752
46921
|
var SourcePackageDependencyGraph = class {
|
45753
46922
|
constructor(analyzer, rootPackages) {
|
@@ -46247,6 +47416,7 @@ var DereferenceOperatorDeclarationEntity = class {
|
|
46247
47416
|
this.kind = 6 /* DereferenceOperator */;
|
46248
47417
|
this._overriddenMembers = new Cached();
|
46249
47418
|
this._modifierFlags = 2048 /* NotComputed */;
|
47419
|
+
this._hasReportedAllDiagnostics = false;
|
46250
47420
|
this._analyzer = analyzer;
|
46251
47421
|
this._getterDeclaration = getterDeclaration;
|
46252
47422
|
this._setterDeclaration = setterDeclaration;
|
@@ -46311,6 +47481,23 @@ var DereferenceOperatorDeclarationEntity = class {
|
|
46311
47481
|
getOverriddenMembers() {
|
46312
47482
|
return this._overriddenMembers.getOrInsertWith(() => this._analyzer.overriddenMember.getOverriddenDereferenceOperators(this._getterOrSetterDeclaration));
|
46313
47483
|
}
|
47484
|
+
ensureAllDiagnosticsReported() {
|
47485
|
+
if (!this._hasReportedAllDiagnostics) {
|
47486
|
+
const diagnostics = this._analyzer.getAcceptorForDiagnosticsComputedLazily();
|
47487
|
+
if (this._getterDeclaration !== void 0 && this._setterDeclaration !== void 0) {
|
47488
|
+
const getterModifiers = this.modifierFlags;
|
47489
|
+
const setterModifiers = createDeclaredModifierFlags(this._setterDeclaration);
|
47490
|
+
ModifierValidator.validateDereferencedVariableAccessorsHaveConsistentModifiers(
|
47491
|
+
this._analyzer,
|
47492
|
+
getterModifiers,
|
47493
|
+
setterModifiers,
|
47494
|
+
this._setterDeclaration.caretToken,
|
47495
|
+
diagnostics
|
47496
|
+
);
|
47497
|
+
}
|
47498
|
+
this._hasReportedAllDiagnostics = true;
|
47499
|
+
}
|
47500
|
+
}
|
46314
47501
|
};
|
46315
47502
|
DereferenceOperatorDeclarationEntity = __decorateClass([
|
46316
47503
|
entityToStringDecorator
|
@@ -46580,6 +47767,7 @@ var IndexerDeclarationEntity = class {
|
|
46580
47767
|
this._parameters = new Cached();
|
46581
47768
|
this._overriddenMembers = new Cached();
|
46582
47769
|
this._modifierFlags = 2048 /* NotComputed */;
|
47770
|
+
this._hasReportedAllDiagnostics = false;
|
46583
47771
|
this._analyzer = analyzer;
|
46584
47772
|
this._getterDeclaration = getterDeclaration;
|
46585
47773
|
this._setterDeclaration = setterDeclaration;
|
@@ -46656,6 +47844,23 @@ var IndexerDeclarationEntity = class {
|
|
46656
47844
|
getOverriddenMembers() {
|
46657
47845
|
return this._overriddenMembers.getOrInsertWith(() => this._analyzer.overriddenMember.getOverriddenIndexers(this._getterOrSetterDeclaration));
|
46658
47846
|
}
|
47847
|
+
ensureAllDiagnosticsReported() {
|
47848
|
+
if (!this._hasReportedAllDiagnostics) {
|
47849
|
+
const diagnostics = this._analyzer.getAcceptorForDiagnosticsComputedLazily();
|
47850
|
+
if (this._getterDeclaration !== void 0 && this._setterDeclaration !== void 0) {
|
47851
|
+
const getterModifiers = this.modifierFlags;
|
47852
|
+
const setterModifiers = createDeclaredModifierFlags(this._setterDeclaration);
|
47853
|
+
ModifierValidator.validateIndexedElementAccessorsHaveConsistentModifiers(
|
47854
|
+
this._analyzer,
|
47855
|
+
getterModifiers,
|
47856
|
+
setterModifiers,
|
47857
|
+
this._setterDeclaration.parameterClause,
|
47858
|
+
diagnostics
|
47859
|
+
);
|
47860
|
+
}
|
47861
|
+
this._hasReportedAllDiagnostics = true;
|
47862
|
+
}
|
47863
|
+
}
|
46659
47864
|
createParameters() {
|
46660
47865
|
const entityByNode = /* @__PURE__ */ new Map();
|
46661
47866
|
const parameters = Query.fromNullable(this._getterDeclaration?.parameterClause.parameterList.parameters).zipLongest(this._setterDeclaration?.parameterClause.parameterList.parameters ?? [], (p1, p2) => {
|
@@ -47906,8 +49111,8 @@ var PackageStructuredTypeDeclarationEntity = class {
|
|
47906
49111
|
getDefinition() {
|
47907
49112
|
return this._data.getDefinition();
|
47908
49113
|
}
|
47909
|
-
|
47910
|
-
return this._data.
|
49114
|
+
markedBasic() {
|
49115
|
+
return this._data.markedBasic();
|
47911
49116
|
}
|
47912
49117
|
isAbstract() {
|
47913
49118
|
return this._data.isAbstract();
|
@@ -47946,8 +49151,7 @@ PackageStructuredTypeDeclarationEntity = __decorateClass([
|
|
47946
49151
|
var SourcePackageStructuredTypeDeclarationData = class {
|
47947
49152
|
constructor(analyzer, node, entity) {
|
47948
49153
|
this._typeParameters = new Cached();
|
47949
|
-
this.
|
47950
|
-
this._baseAspectTypes = new Cached();
|
49154
|
+
this._baseTypes = new Cached();
|
47951
49155
|
this._members = new Cached();
|
47952
49156
|
this._modifierFlags = 2048 /* NotComputed */;
|
47953
49157
|
this._analyzer = analyzer;
|
@@ -48001,7 +49205,7 @@ var SourcePackageStructuredTypeDeclarationData = class {
|
|
48001
49205
|
getDefinition() {
|
48002
49206
|
return { kind: 0 /* Source */, node: this._node };
|
48003
49207
|
}
|
48004
|
-
|
49208
|
+
markedBasic() {
|
48005
49209
|
return (this.modifierFlags & 32 /* Basic */) !== 0;
|
48006
49210
|
}
|
48007
49211
|
isAbstract() {
|
@@ -48020,19 +49224,10 @@ var SourcePackageStructuredTypeDeclarationData = class {
|
|
48020
49224
|
return this.getTypeParameters().length;
|
48021
49225
|
}
|
48022
49226
|
getBaseObjectType() {
|
48023
|
-
return this.
|
48024
|
-
let type = Query.fromNullable(this._node.body.baseTypeList?.baseTypes).map((t) => this._analyzer.type.ofTypeSpecifier(t)).first((t) => this._analyzer.typeIsValidBaseObjectType(t));
|
48025
|
-
if (type === void 0) {
|
48026
|
-
type = this._analyzer.getImplicitBaseTypeForStructuredType(this._entity);
|
48027
|
-
}
|
48028
|
-
return new BaseObjectType(type);
|
48029
|
-
});
|
49227
|
+
return this.getBaseTypes().baseObjectType;
|
48030
49228
|
}
|
48031
49229
|
getBaseAspectTypes() {
|
48032
|
-
return this.
|
48033
|
-
const types = Query.fromNullable(this._node.body.baseTypeList?.baseTypes).map((t) => this._analyzer.type.ofTypeSpecifier(t)).filter((t) => this._analyzer.typeIsValidBaseAspectType(t)).toArray();
|
48034
|
-
return new BaseAspectTypes(types);
|
48035
|
-
});
|
49230
|
+
return this.getBaseTypes().baseAspectTypes;
|
48036
49231
|
}
|
48037
49232
|
isHidden() {
|
48038
49233
|
return this._analyzer.createPackageMemberHiding(this._node, this.modifierFlags);
|
@@ -48043,6 +49238,23 @@ var SourcePackageStructuredTypeDeclarationData = class {
|
|
48043
49238
|
getSubstitutionApplicationMode() {
|
48044
49239
|
return 0 /* SubstituteOwnSubstitutions */;
|
48045
49240
|
}
|
49241
|
+
getBaseTypes() {
|
49242
|
+
return this._baseTypes.getOrInsertWith(() => {
|
49243
|
+
if (this._node.body.baseTypeList === void 0) {
|
49244
|
+
return {
|
49245
|
+
baseObjectType: new BaseObjectType(this._analyzer.getImplicitBaseTypeForStructuredType(this._entity)),
|
49246
|
+
baseAspectTypes: new BaseAspectTypes([])
|
49247
|
+
};
|
49248
|
+
} else {
|
49249
|
+
return validateBaseTypeListAndCreateBaseTypes(
|
49250
|
+
this._analyzer,
|
49251
|
+
this._node.body.baseTypeList,
|
49252
|
+
this._entity,
|
49253
|
+
this._analyzer.getAcceptorForDiagnosticsComputedLazily()
|
49254
|
+
);
|
49255
|
+
}
|
49256
|
+
});
|
49257
|
+
}
|
48046
49258
|
};
|
48047
49259
|
var AnonymousStructuredTypeDeclarationEntity = class {
|
48048
49260
|
constructor(_analyzer, _node) {
|
@@ -48051,8 +49263,7 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
48051
49263
|
this.kind = 2 /* Type */;
|
48052
49264
|
this.typeEntityKind = 1 /* Structured */;
|
48053
49265
|
this.subkind = "anonymous";
|
48054
|
-
this.
|
48055
|
-
this._baseAspectTypes = new Cached();
|
49266
|
+
this._baseTypes = new Cached();
|
48056
49267
|
this._members = new Cached();
|
48057
49268
|
}
|
48058
49269
|
getNaming() {
|
@@ -48088,7 +49299,7 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
48088
49299
|
getDefinition() {
|
48089
49300
|
return { kind: 0 /* Source */, node: this._node };
|
48090
49301
|
}
|
48091
|
-
|
49302
|
+
markedBasic() {
|
48092
49303
|
return false;
|
48093
49304
|
}
|
48094
49305
|
isAbstract() {
|
@@ -48107,19 +49318,10 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
48107
49318
|
return 0;
|
48108
49319
|
}
|
48109
49320
|
getBaseObjectType() {
|
48110
|
-
return this.
|
48111
|
-
let type = Query.fromNullable(this._node.body.baseTypeList?.baseTypes).map((t) => this._analyzer.type.ofTypeSpecifier(t)).first((t) => this._analyzer.typeIsValidBaseObjectType(t));
|
48112
|
-
if (type === void 0) {
|
48113
|
-
type = this._analyzer.getImplicitBaseTypeForStructuredType(this);
|
48114
|
-
}
|
48115
|
-
return new BaseObjectType(type);
|
48116
|
-
});
|
49321
|
+
return this.getBaseTypes().baseObjectType;
|
48117
49322
|
}
|
48118
49323
|
getBaseAspectTypes() {
|
48119
|
-
return this.
|
48120
|
-
const types = Query.fromNullable(this._node.body.baseTypeList?.baseTypes).map((t) => this._analyzer.type.ofTypeSpecifier(t)).filter((t) => this._analyzer.typeIsValidBaseAspectType(t)).toArray();
|
48121
|
-
return new BaseAspectTypes(types);
|
48122
|
-
});
|
49324
|
+
return this.getBaseTypes().baseAspectTypes;
|
48123
49325
|
}
|
48124
49326
|
isHidden() {
|
48125
49327
|
return void 0;
|
@@ -48133,6 +49335,23 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
48133
49335
|
getContainingPackage() {
|
48134
49336
|
return TreeQuery.fromNode(this._node).packageEntity(this._analyzer);
|
48135
49337
|
}
|
49338
|
+
getBaseTypes() {
|
49339
|
+
return this._baseTypes.getOrInsertWith(() => {
|
49340
|
+
if (this._node.body.baseTypeList === void 0) {
|
49341
|
+
return {
|
49342
|
+
baseObjectType: new BaseObjectType(this._analyzer.getImplicitBaseTypeForStructuredType(this)),
|
49343
|
+
baseAspectTypes: new BaseAspectTypes([])
|
49344
|
+
};
|
49345
|
+
} else {
|
49346
|
+
return validateBaseTypeListAndCreateBaseTypes(
|
49347
|
+
this._analyzer,
|
49348
|
+
this._node.body.baseTypeList,
|
49349
|
+
this,
|
49350
|
+
this._analyzer.getAcceptorForDiagnosticsComputedLazily()
|
49351
|
+
);
|
49352
|
+
}
|
49353
|
+
});
|
49354
|
+
}
|
48136
49355
|
};
|
48137
49356
|
AnonymousStructuredTypeDeclarationEntity = __decorateClass([
|
48138
49357
|
entityToStringDecorator
|
@@ -48222,7 +49441,7 @@ var IntrinsicPackageStructuredTypeEntity = class {
|
|
48222
49441
|
getDefinition() {
|
48223
49442
|
return { kind: 1 /* Intrinsic */ };
|
48224
49443
|
}
|
48225
|
-
|
49444
|
+
markedBasic() {
|
48226
49445
|
return this._isBasic;
|
48227
49446
|
}
|
48228
49447
|
isAbstract() {
|
@@ -48334,7 +49553,7 @@ var IntrinsicAnonymousStructuredTypeEntity = class {
|
|
48334
49553
|
getDefinition() {
|
48335
49554
|
return { kind: 1 /* Intrinsic */ };
|
48336
49555
|
}
|
48337
|
-
|
49556
|
+
markedBasic() {
|
48338
49557
|
return false;
|
48339
49558
|
}
|
48340
49559
|
isAbstract() {
|
@@ -48376,6 +49595,64 @@ var IntrinsicAnonymousStructuredTypeEntity = class {
|
|
48376
49595
|
IntrinsicAnonymousStructuredTypeEntity = __decorateClass([
|
48377
49596
|
entityToStringDecorator
|
48378
49597
|
], IntrinsicAnonymousStructuredTypeEntity);
|
49598
|
+
function validateBaseTypeListAndCreateBaseTypes(analyzer, baseTypeList, entity, diagnostics) {
|
49599
|
+
let declaredBaseObjectType;
|
49600
|
+
const declaredBaseAspectTypes = new Array();
|
49601
|
+
for (const baseTypeSpecifier of baseTypeList.baseTypes) {
|
49602
|
+
const baseType = analyzer.type.ofTypeSpecifier(baseTypeSpecifier);
|
49603
|
+
const unaliasedBaseType = unaliasType(baseType);
|
49604
|
+
if (unaliasedBaseType.kind === "structured") {
|
49605
|
+
if (unaliasedBaseType.isRefObject()) {
|
49606
|
+
if (declaredBaseObjectType !== void 0) {
|
49607
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49608
|
+
312 /* TypeCanNotHaveMultipleBaseObjectTypes */,
|
49609
|
+
baseTypeSpecifier
|
49610
|
+
));
|
49611
|
+
} else if (entity.isPlainObject()) {
|
49612
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49613
|
+
317 /* PlainObjectTypeCanHaveOnlyAspectsAsBaseTypes */,
|
49614
|
+
baseTypeSpecifier
|
49615
|
+
));
|
49616
|
+
} else if (entity.isAspect()) {
|
49617
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49618
|
+
318 /* AspectTypeCanHaveOnlyAspectsAsBaseTypes */,
|
49619
|
+
baseTypeSpecifier
|
49620
|
+
));
|
49621
|
+
} else if (!unaliasedBaseType.markedBasic() && !unaliasedBaseType.isAbstract()) {
|
49622
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49623
|
+
313 /* TypeThatIsNotMarkedAsBasicCanNotBeUsedAsBaseType */,
|
49624
|
+
baseTypeSpecifier
|
49625
|
+
));
|
49626
|
+
} else {
|
49627
|
+
declaredBaseObjectType = baseType;
|
49628
|
+
}
|
49629
|
+
} else if (unaliasedBaseType.isPlainObject()) {
|
49630
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49631
|
+
314 /* PlainObjectTypeCanNotBeUsedAsBaseType */,
|
49632
|
+
baseTypeSpecifier
|
49633
|
+
));
|
49634
|
+
} else if (unaliasedBaseType.isAspect()) {
|
49635
|
+
if (declaredBaseAspectTypes.some((t) => unaliasType(t).equals(unaliasedBaseType))) {
|
49636
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49637
|
+
315 /* ThisTypeIsAlreadyListedInBaseTypeList */,
|
49638
|
+
baseTypeSpecifier
|
49639
|
+
));
|
49640
|
+
} else {
|
49641
|
+
declaredBaseAspectTypes.push(baseType);
|
49642
|
+
}
|
49643
|
+
}
|
49644
|
+
} else {
|
49645
|
+
diagnostics.addDiagnostic(analyzer.createNodeDiagnostic(
|
49646
|
+
316 /* OnlyObjectAndAspectTypesCanBeUsedAsBaseTypes */,
|
49647
|
+
baseTypeSpecifier
|
49648
|
+
));
|
49649
|
+
}
|
49650
|
+
}
|
49651
|
+
return {
|
49652
|
+
baseObjectType: new BaseObjectType(declaredBaseObjectType ?? analyzer.getImplicitBaseTypeForStructuredType(entity)),
|
49653
|
+
baseAspectTypes: new BaseAspectTypes(declaredBaseAspectTypes)
|
49654
|
+
};
|
49655
|
+
}
|
48379
49656
|
|
48380
49657
|
// source/entities/SubstitutionApplicationMode.ts
|
48381
49658
|
var SubstitutionApplicationMode = /* @__PURE__ */ ((SubstitutionApplicationMode2) => {
|
@@ -49028,12 +50305,12 @@ function isTypeMemberEntity(entity) {
|
|
49028
50305
|
}
|
49029
50306
|
}
|
49030
50307
|
var TypeMemberEntity;
|
49031
|
-
((
|
50308
|
+
((TypeMemberEntity7) => {
|
49032
50309
|
function isAspectTypeMember(entity) {
|
49033
50310
|
const container = entity.getContainer();
|
49034
50311
|
return container.kind === "type" && container.typeEntity.typeEntityKind === 1 /* Structured */ && container.typeEntity.isAspect();
|
49035
50312
|
}
|
49036
|
-
|
50313
|
+
TypeMemberEntity7.isAspectTypeMember = isAspectTypeMember;
|
49037
50314
|
function isStatic(entity) {
|
49038
50315
|
switch (entity.kind) {
|
49039
50316
|
case 0 /* Variable */:
|
@@ -49049,7 +50326,7 @@ var TypeMemberEntity;
|
|
49049
50326
|
Debug.never(entity);
|
49050
50327
|
}
|
49051
50328
|
}
|
49052
|
-
|
50329
|
+
TypeMemberEntity7.isStatic = isStatic;
|
49053
50330
|
function markedBasic(entity) {
|
49054
50331
|
switch (entity.kind) {
|
49055
50332
|
case 0 /* Variable */:
|
@@ -49065,7 +50342,7 @@ var TypeMemberEntity;
|
|
49065
50342
|
Debug.never(entity);
|
49066
50343
|
}
|
49067
50344
|
}
|
49068
|
-
|
50345
|
+
TypeMemberEntity7.markedBasic = markedBasic;
|
49069
50346
|
function isBasic(entity) {
|
49070
50347
|
switch (entity.kind) {
|
49071
50348
|
case 0 /* Variable */:
|
@@ -49081,11 +50358,11 @@ var TypeMemberEntity;
|
|
49081
50358
|
Debug.never(entity);
|
49082
50359
|
}
|
49083
50360
|
}
|
49084
|
-
|
50361
|
+
TypeMemberEntity7.isBasic = isBasic;
|
49085
50362
|
function isAbstract(entity) {
|
49086
|
-
return entity.markedAbstract() || isAspectTypeMember(entity) && !markedBasic(entity) && !isStatic(entity);
|
50363
|
+
return entity.markedAbstract() || isAspectTypeMember(entity) && !markedBasic(entity) && !isStatic(entity) && entity.isHidden()?.kind !== "type";
|
49087
50364
|
}
|
49088
|
-
|
50365
|
+
TypeMemberEntity7.isAbstract = isAbstract;
|
49089
50366
|
})(TypeMemberEntity || (TypeMemberEntity = {}));
|
49090
50367
|
function entityToStringDecorator(constructor) {
|
49091
50368
|
if (!("debuggerDisplay" in constructor.prototype)) {
|
@@ -56919,6 +58196,7 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
56919
58196
|
const nodePathText = NodePath.ofNode(node.sourceLocation.node).toString();
|
56920
58197
|
const locationText = URI.from({
|
56921
58198
|
scheme: fileUri.scheme,
|
58199
|
+
authority: fileUri.authority,
|
56922
58200
|
path: fileUri.segments.join("/"),
|
56923
58201
|
fragment: nodePathText
|
56924
58202
|
}).toString();
|
@@ -61917,6 +63195,7 @@ export {
|
|
61917
63195
|
performanceMeasurementStages,
|
61918
63196
|
performanceMeasurementStageNames,
|
61919
63197
|
AccessKind,
|
63198
|
+
ArrayUtils,
|
61920
63199
|
getFileExtension,
|
61921
63200
|
isSourceOrConfigurationFileName,
|
61922
63201
|
Cached,
|
@@ -62140,6 +63419,9 @@ export {
|
|
62140
63419
|
IntrinsicConstructorEntity,
|
62141
63420
|
DefaultConstructorEntity,
|
62142
63421
|
VariableToInitialize,
|
63422
|
+
findModifier,
|
63423
|
+
createDeclaredModifierFlags,
|
63424
|
+
modifierToModifierFlag,
|
62143
63425
|
DereferenceOperatorDeclarationEntity,
|
62144
63426
|
DestructorDeclarationEntity,
|
62145
63427
|
EntityHidingLevel_type,
|
@@ -62302,8 +63584,6 @@ export {
|
|
62302
63584
|
ExpressionDenotesOperatorCheckResult,
|
62303
63585
|
DeclaredTypeMemberEntities,
|
62304
63586
|
DiagnosticCollector,
|
62305
|
-
findModifier,
|
62306
|
-
createDeclaredModifierFlags,
|
62307
63587
|
SourcePackageDependencyGraph,
|
62308
63588
|
WellKnownDeclarationsLoadError,
|
62309
63589
|
WellKnownDeclarations,
|