@artel/artc 0.6.25232 → 0.6.25233
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 +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1 -1
- package/build/{chunk-S7ZUX7EX.js → chunk-SCSDVK4I.js} +1 -1
- package/build/{chunk-E72KEKQV.js → chunk-T4JAN46C.js} +729 -547
- package/build/{chunk-QDDCF32T.js → chunk-YA4OCEDT.js} +2 -2
- package/build/types/analysis/Analyzer.d.ts +18 -14
- package/build/types/analysis/DiagnosticCollector.d.ts +0 -2
- package/build/types/analysis/ModifierValidator.d.ts +3 -3
- package/build/types/emitter/ir/Nodes.d.ts +4 -4
- package/package.json +1 -1
@@ -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.25233" : "";
|
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");
|
@@ -16862,18 +16862,26 @@ var IntersectionType = class {
|
|
16862
16862
|
if (this === other) {
|
16863
16863
|
return true;
|
16864
16864
|
}
|
16865
|
-
if (
|
16865
|
+
if (other.kind !== "intersection") {
|
16866
16866
|
return false;
|
16867
16867
|
}
|
16868
|
-
const
|
16869
|
-
|
16870
|
-
|
16871
|
-
|
16872
|
-
|
16868
|
+
const thisTypes = this.originalTypes;
|
16869
|
+
const otherTypes = other.originalTypes;
|
16870
|
+
if (thisTypes.length !== otherTypes.length) {
|
16871
|
+
return false;
|
16872
|
+
} else if (thisTypes.length === 0) {
|
16873
|
+
return true;
|
16874
|
+
} else {
|
16875
|
+
const otherTypesMutable = Array.from(otherTypes);
|
16876
|
+
for (const type of thisTypes) {
|
16877
|
+
const otherTypeIndex = otherTypesMutable.findIndex((t) => t.equals(type));
|
16878
|
+
if (otherTypeIndex === -1) {
|
16879
|
+
return false;
|
16880
|
+
}
|
16881
|
+
ArrayUtils.removeElement(otherTypesMutable, otherTypeIndex);
|
16873
16882
|
}
|
16874
|
-
|
16883
|
+
return true;
|
16875
16884
|
}
|
16876
|
-
return true;
|
16877
16885
|
}
|
16878
16886
|
getSubstitutions() {
|
16879
16887
|
return Substitutions.empty(this._analyzer);
|
@@ -17721,18 +17729,28 @@ var UnionType = class {
|
|
17721
17729
|
if (this === other) {
|
17722
17730
|
return true;
|
17723
17731
|
}
|
17724
|
-
if (
|
17732
|
+
if (other.kind !== "union") {
|
17725
17733
|
return false;
|
17726
17734
|
}
|
17727
|
-
const
|
17728
|
-
|
17729
|
-
|
17730
|
-
|
17731
|
-
|
17735
|
+
const thisTypes = this.originalTypes;
|
17736
|
+
const otherTypes = other.originalTypes;
|
17737
|
+
if (thisTypes.length !== otherTypes.length) {
|
17738
|
+
return false;
|
17739
|
+
} else if (thisTypes.length === 0) {
|
17740
|
+
return true;
|
17741
|
+
} else if (thisTypes.length === 2) {
|
17742
|
+
return thisTypes[0].equals(otherTypes[0]) && thisTypes[1].equals(otherTypes[1]) || thisTypes[0].equals(otherTypes[1]) && thisTypes[1].equals(otherTypes[0]);
|
17743
|
+
} else {
|
17744
|
+
const otherTypesMutable = Array.from(otherTypes);
|
17745
|
+
for (const type of thisTypes) {
|
17746
|
+
const otherTypeIndex = otherTypesMutable.findIndex((t) => t.equals(type));
|
17747
|
+
if (otherTypeIndex === -1) {
|
17748
|
+
return false;
|
17749
|
+
}
|
17750
|
+
ArrayUtils.removeElement(otherTypesMutable, otherTypeIndex);
|
17732
17751
|
}
|
17733
|
-
|
17752
|
+
return true;
|
17734
17753
|
}
|
17735
|
-
return true;
|
17736
17754
|
}
|
17737
17755
|
getSubstitutions() {
|
17738
17756
|
return Substitutions.empty(this._analyzer);
|
@@ -27893,6 +27911,7 @@ var ModifierValidator = class _ModifierValidator {
|
|
27893
27911
|
this._diagnostics = _diagnostics;
|
27894
27912
|
this._locale = _locale;
|
27895
27913
|
this._dialect = _dialect;
|
27914
|
+
this.effectiveModifiers = [];
|
27896
27915
|
}
|
27897
27916
|
static {
|
27898
27917
|
this.allowedPackageMemberHidingModifiers = 17 /* HiddenInPackageOrWithoutLevel */ | 8 /* HiddenInFile */;
|
@@ -27997,9 +28016,9 @@ var ModifierValidator = class _ModifierValidator {
|
|
27997
28016
|
validateTopLevelPackageMembers(list) {
|
27998
28017
|
this.validatePackageMembers(list, 0 /* None */);
|
27999
28018
|
}
|
28000
|
-
validateTopLevelTypeMembers(
|
28019
|
+
validateTopLevelTypeMembers(memberList, declarationWithMembersKind, isTypeMarkedAbstract, isTypeMarkedBasic) {
|
28001
28020
|
this.validateTypeMembers(
|
28002
|
-
|
28021
|
+
memberList,
|
28003
28022
|
declarationWithMembersKind,
|
28004
28023
|
isTypeMarkedAbstract,
|
28005
28024
|
isTypeMarkedBasic,
|
@@ -28081,104 +28100,141 @@ var ModifierValidator = class _ModifierValidator {
|
|
28081
28100
|
}
|
28082
28101
|
validatePackageMembers(list, parentGroupFlags) {
|
28083
28102
|
for (const declaration of list.declarations) {
|
28084
|
-
|
28085
|
-
|
28086
|
-
|
28087
|
-
|
28088
|
-
|
28089
|
-
|
28090
|
-
|
28091
|
-
|
28092
|
-
|
28093
|
-
|
28094
|
-
|
28095
|
-
const declarationKind = 11 /* VariableDeclaration */;
|
28096
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28097
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28098
|
-
break;
|
28099
|
-
}
|
28100
|
-
case 27 /* PackageFunctionDeclaration */: {
|
28101
|
-
const declarationKind = 6 /* FunctionDeclaration */;
|
28102
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28103
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28104
|
-
break;
|
28105
|
-
}
|
28106
|
-
case 36 /* PackageVariableGetterDeclaration */: {
|
28107
|
-
const declarationKind = 12 /* VariableGetterDeclaration */;
|
28108
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28109
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28110
|
-
break;
|
28111
|
-
}
|
28112
|
-
case 37 /* PackageVariableSetterDeclaration */: {
|
28113
|
-
const declarationKind = 13 /* VariableSetterDeclaration */;
|
28114
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28115
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28116
|
-
break;
|
28117
|
-
}
|
28118
|
-
case 38 /* PackageVariantTypeDeclaration */: {
|
28119
|
-
const declarationKind = 14 /* VariantTypeDeclaration */;
|
28120
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28121
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28122
|
-
break;
|
28123
|
-
}
|
28124
|
-
case 22 /* PackageAliasTypeDeclaration */: {
|
28125
|
-
const declarationKind = 1 /* AliasTypeDeclaration */;
|
28126
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28127
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28128
|
-
break;
|
28129
|
-
}
|
28130
|
-
case 28 /* PackageFunctionTypeDeclaration */: {
|
28131
|
-
const declarationKind = 7 /* FunctionTypeDeclaration */;
|
28132
|
-
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28133
|
-
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration.name, parentGroupFlags);
|
28134
|
-
break;
|
28135
|
-
}
|
28136
|
-
case 33 /* PackageStructuredTypeDeclaration */: {
|
28137
|
-
let declarationKind;
|
28138
|
-
switch (declaration.body.structuredTypeKindKeyword.keywordKind) {
|
28139
|
-
case 3 /* Aspect */:
|
28140
|
-
declarationKind = 10 /* AspectTypeDeclaration */;
|
28141
|
-
break;
|
28142
|
-
case 4 /* Object */:
|
28143
|
-
declarationKind = 8 /* ObjectTypeDeclaration */;
|
28144
|
-
break;
|
28145
|
-
case 5 /* PlainObject */:
|
28146
|
-
declarationKind = 9 /* PlainObjectTypeDeclaration */;
|
28147
|
-
break;
|
28148
|
-
default:
|
28149
|
-
Debug.never(declaration.body.structuredTypeKindKeyword);
|
28103
|
+
this.effectiveModifiers.push(declaration.modifierList);
|
28104
|
+
try {
|
28105
|
+
switch (declaration.kind) {
|
28106
|
+
case 24 /* PackageMemberGroupDeclaration */: {
|
28107
|
+
const groupFlags = this.validatePackageMemberModifierList(
|
28108
|
+
declaration.modifierList,
|
28109
|
+
2 /* MemberGroupDeclaration */,
|
28110
|
+
parentGroupFlags
|
28111
|
+
);
|
28112
|
+
this.validatePackageMembers(declaration.declarationList, groupFlags);
|
28113
|
+
break;
|
28150
28114
|
}
|
28151
|
-
|
28152
|
-
|
28153
|
-
|
28154
|
-
|
28155
|
-
|
28156
|
-
|
28157
|
-
|
28158
|
-
|
28159
|
-
|
28160
|
-
|
28161
|
-
|
28162
|
-
|
28163
|
-
|
28164
|
-
|
28165
|
-
|
28166
|
-
|
28167
|
-
|
28168
|
-
|
28169
|
-
|
28115
|
+
case 35 /* PackageVariableDeclaration */: {
|
28116
|
+
const declarationKind = 11 /* VariableDeclaration */;
|
28117
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28118
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28119
|
+
declarationKind,
|
28120
|
+
declaration.name,
|
28121
|
+
parentGroupFlags
|
28122
|
+
);
|
28123
|
+
break;
|
28124
|
+
}
|
28125
|
+
case 27 /* PackageFunctionDeclaration */: {
|
28126
|
+
const declarationKind = 6 /* FunctionDeclaration */;
|
28127
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28128
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28129
|
+
declarationKind,
|
28130
|
+
declaration.name,
|
28131
|
+
parentGroupFlags
|
28132
|
+
);
|
28133
|
+
break;
|
28134
|
+
}
|
28135
|
+
case 36 /* PackageVariableGetterDeclaration */: {
|
28136
|
+
const declarationKind = 12 /* VariableGetterDeclaration */;
|
28137
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28138
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28139
|
+
declarationKind,
|
28140
|
+
declaration.name,
|
28141
|
+
parentGroupFlags
|
28142
|
+
);
|
28143
|
+
break;
|
28144
|
+
}
|
28145
|
+
case 37 /* PackageVariableSetterDeclaration */: {
|
28146
|
+
const declarationKind = 13 /* VariableSetterDeclaration */;
|
28147
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28148
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28149
|
+
declarationKind,
|
28150
|
+
declaration.name,
|
28151
|
+
parentGroupFlags
|
28152
|
+
);
|
28153
|
+
break;
|
28154
|
+
}
|
28155
|
+
case 38 /* PackageVariantTypeDeclaration */: {
|
28156
|
+
const declarationKind = 14 /* VariantTypeDeclaration */;
|
28157
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28158
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28159
|
+
declarationKind,
|
28160
|
+
declaration.name,
|
28161
|
+
parentGroupFlags
|
28162
|
+
);
|
28163
|
+
break;
|
28164
|
+
}
|
28165
|
+
case 22 /* PackageAliasTypeDeclaration */: {
|
28166
|
+
const declarationKind = 1 /* AliasTypeDeclaration */;
|
28167
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28168
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28169
|
+
declarationKind,
|
28170
|
+
declaration.name,
|
28171
|
+
parentGroupFlags
|
28172
|
+
);
|
28173
|
+
break;
|
28174
|
+
}
|
28175
|
+
case 28 /* PackageFunctionTypeDeclaration */: {
|
28176
|
+
const declarationKind = 7 /* FunctionTypeDeclaration */;
|
28177
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28178
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28179
|
+
declarationKind,
|
28180
|
+
declaration.name,
|
28181
|
+
parentGroupFlags
|
28182
|
+
);
|
28183
|
+
break;
|
28184
|
+
}
|
28185
|
+
case 33 /* PackageStructuredTypeDeclaration */: {
|
28186
|
+
let declarationKind;
|
28187
|
+
switch (declaration.body.structuredTypeKindKeyword.keywordKind) {
|
28188
|
+
case 3 /* Aspect */:
|
28189
|
+
declarationKind = 10 /* AspectTypeDeclaration */;
|
28190
|
+
break;
|
28191
|
+
case 4 /* Object */:
|
28192
|
+
declarationKind = 8 /* ObjectTypeDeclaration */;
|
28193
|
+
break;
|
28194
|
+
case 5 /* PlainObject */:
|
28195
|
+
declarationKind = 9 /* PlainObjectTypeDeclaration */;
|
28196
|
+
break;
|
28197
|
+
default:
|
28198
|
+
Debug.never(declaration.body.structuredTypeKindKeyword);
|
28199
|
+
}
|
28200
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28201
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28202
|
+
declarationKind,
|
28203
|
+
declaration.name,
|
28204
|
+
parentGroupFlags
|
28205
|
+
);
|
28206
|
+
break;
|
28207
|
+
}
|
28208
|
+
case 40 /* TypeExtensionDeclaration */: {
|
28209
|
+
const declarationKind = 3 /* TypeExtensionDeclaration */;
|
28210
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28211
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(
|
28212
|
+
declarationKind,
|
28213
|
+
declaration.extendedTypeClause,
|
28214
|
+
parentGroupFlags
|
28215
|
+
);
|
28216
|
+
break;
|
28217
|
+
}
|
28218
|
+
case 43 /* InvalidPackageMemberDeclaration */: {
|
28219
|
+
const declarationKind = 15 /* InvalidDeclaration */;
|
28220
|
+
this.validatePackageMemberModifierList(declaration.modifierList, declarationKind, parentGroupFlags);
|
28221
|
+
this.validatePackageMemberCanBePlacedInGroupWithModifiers(declarationKind, declaration, parentGroupFlags);
|
28222
|
+
break;
|
28223
|
+
}
|
28224
|
+
case 26 /* PackageEntryPointDeclaration */:
|
28225
|
+
this.validatePackageEntryPointDeclaration(declaration, parentGroupFlags);
|
28226
|
+
break;
|
28227
|
+
case 25 /* PackageConstructorDeclaration */:
|
28228
|
+
this.validatePackageConstructorDeclaration(declaration, parentGroupFlags);
|
28229
|
+
break;
|
28230
|
+
case 21 /* TranslationsDeclaration */:
|
28231
|
+
this.validateTranslationsDeclaration(declaration, parentGroupFlags);
|
28232
|
+
break;
|
28233
|
+
default:
|
28234
|
+
Debug.never(declaration);
|
28170
28235
|
}
|
28171
|
-
|
28172
|
-
|
28173
|
-
break;
|
28174
|
-
case 25 /* PackageConstructorDeclaration */:
|
28175
|
-
this.validatePackageConstructorDeclaration(declaration, parentGroupFlags);
|
28176
|
-
break;
|
28177
|
-
case 21 /* TranslationsDeclaration */:
|
28178
|
-
this.validateTranslationsDeclaration(declaration, parentGroupFlags);
|
28179
|
-
break;
|
28180
|
-
default:
|
28181
|
-
Debug.never(declaration);
|
28236
|
+
} finally {
|
28237
|
+
this.effectiveModifiers.pop();
|
28182
28238
|
}
|
28183
28239
|
}
|
28184
28240
|
}
|
@@ -28206,7 +28262,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28206
28262
|
modifier
|
28207
28263
|
));
|
28208
28264
|
} else if ((flags & 64 /* Abstract */) !== 0) {
|
28209
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28265
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28266
|
+
modifier,
|
28267
|
+
this.findModifier(64 /* Abstract */)
|
28268
|
+
);
|
28210
28269
|
}
|
28211
28270
|
flags |= flag;
|
28212
28271
|
break;
|
@@ -28221,7 +28280,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28221
28280
|
modifier
|
28222
28281
|
));
|
28223
28282
|
} else if ((flags & 128 /* Basic */) !== 0) {
|
28224
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28283
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28284
|
+
modifier,
|
28285
|
+
this.findModifier(128 /* Basic */)
|
28286
|
+
);
|
28225
28287
|
}
|
28226
28288
|
flags |= flag;
|
28227
28289
|
break;
|
@@ -28231,7 +28293,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28231
28293
|
if ((flags & flag) !== 0) {
|
28232
28294
|
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28233
28295
|
} else if (declarationKind === 2 /* MemberGroupDeclaration */ && (flags & 512 /* Async */) !== 0) {
|
28234
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28296
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28297
|
+
modifier,
|
28298
|
+
this.findModifier(512 /* Async */)
|
28299
|
+
);
|
28235
28300
|
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 11 /* VariableDeclaration */)) {
|
28236
28301
|
this.reportModifierIsNotAllowedHere(modifier);
|
28237
28302
|
}
|
@@ -28243,7 +28308,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28243
28308
|
if ((flags & flag) !== 0) {
|
28244
28309
|
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28245
28310
|
} else if (declarationKind === 2 /* MemberGroupDeclaration */ && (flags & 1024 /* Const */) !== 0) {
|
28246
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28311
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28312
|
+
modifier,
|
28313
|
+
this.findModifier(1024 /* Const */)
|
28314
|
+
);
|
28247
28315
|
} else if (!(declarationKind === 2 /* MemberGroupDeclaration */ || declarationKind === 6 /* FunctionDeclaration */)) {
|
28248
28316
|
this.reportModifierIsNotAllowedHere(modifier);
|
28249
28317
|
}
|
@@ -28266,7 +28334,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28266
28334
|
if (presentNotAllowedFlags !== 0 /* None */) {
|
28267
28335
|
this.forEachModifierFlag(
|
28268
28336
|
presentNotAllowedFlags,
|
28269
|
-
(f) =>
|
28337
|
+
(f) => {
|
28338
|
+
const modifier = this.findModifier(f);
|
28339
|
+
this.reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, modifier);
|
28340
|
+
}
|
28270
28341
|
);
|
28271
28342
|
}
|
28272
28343
|
}
|
@@ -28300,115 +28371,124 @@ var ModifierValidator = class _ModifierValidator {
|
|
28300
28371
|
));
|
28301
28372
|
}
|
28302
28373
|
}
|
28303
|
-
validateTypeMembers(
|
28304
|
-
for (const declaration of
|
28305
|
-
|
28306
|
-
|
28307
|
-
|
28308
|
-
|
28309
|
-
|
28310
|
-
|
28311
|
-
|
28312
|
-
|
28313
|
-
|
28314
|
-
|
28315
|
-
|
28316
|
-
|
28317
|
-
|
28318
|
-
|
28319
|
-
|
28320
|
-
|
28321
|
-
|
28322
|
-
|
28323
|
-
|
28324
|
-
|
28325
|
-
|
28326
|
-
|
28327
|
-
|
28328
|
-
|
28329
|
-
|
28330
|
-
|
28331
|
-
|
28332
|
-
|
28333
|
-
|
28334
|
-
|
28335
|
-
|
28336
|
-
|
28337
|
-
|
28338
|
-
|
28339
|
-
|
28340
|
-
|
28341
|
-
|
28342
|
-
|
28343
|
-
|
28344
|
-
|
28345
|
-
|
28346
|
-
|
28347
|
-
|
28348
|
-
|
28349
|
-
|
28350
|
-
|
28351
|
-
|
28352
|
-
|
28353
|
-
|
28354
|
-
|
28355
|
-
|
28356
|
-
|
28357
|
-
|
28358
|
-
|
28359
|
-
|
28360
|
-
|
28361
|
-
|
28362
|
-
|
28363
|
-
|
28364
|
-
|
28365
|
-
|
28366
|
-
|
28367
|
-
|
28368
|
-
|
28369
|
-
|
28370
|
-
|
28371
|
-
|
28372
|
-
|
28373
|
-
|
28374
|
-
|
28375
|
-
|
28376
|
-
|
28377
|
-
|
28378
|
-
|
28379
|
-
|
28380
|
-
|
28381
|
-
|
28382
|
-
|
28383
|
-
|
28384
|
-
|
28385
|
-
|
28386
|
-
|
28387
|
-
|
28388
|
-
|
28389
|
-
|
28390
|
-
|
28391
|
-
|
28392
|
-
|
28393
|
-
|
28394
|
-
|
28395
|
-
|
28396
|
-
|
28397
|
-
|
28398
|
-
|
28399
|
-
|
28400
|
-
|
28401
|
-
|
28402
|
-
|
28403
|
-
|
28404
|
-
|
28405
|
-
|
28406
|
-
|
28407
|
-
|
28408
|
-
|
28409
|
-
|
28410
|
-
|
28411
|
-
|
28374
|
+
validateTypeMembers(memberList, declarationWithMembersKind, isTypeMarkedAbstract, isTypeMarkedBasic, parentGroupFlags) {
|
28375
|
+
for (const declaration of memberList.members) {
|
28376
|
+
this.effectiveModifiers.push(declaration.modifierList);
|
28377
|
+
try {
|
28378
|
+
const flags = this.validateTypeMemberModifierList(
|
28379
|
+
declaration.modifierList,
|
28380
|
+
declaration.kind,
|
28381
|
+
declarationWithMembersKind,
|
28382
|
+
isTypeMarkedAbstract,
|
28383
|
+
isTypeMarkedBasic,
|
28384
|
+
parentGroupFlags
|
28385
|
+
);
|
28386
|
+
switch (declaration.kind) {
|
28387
|
+
case 44 /* TypeMemberGroupDeclaration */:
|
28388
|
+
this.validateTypeMembers(
|
28389
|
+
declaration.memberBlock.memberList,
|
28390
|
+
declarationWithMembersKind,
|
28391
|
+
isTypeMarkedAbstract,
|
28392
|
+
isTypeMarkedBasic,
|
28393
|
+
flags
|
28394
|
+
);
|
28395
|
+
break;
|
28396
|
+
case 45 /* ConstructorDeclaration */:
|
28397
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28398
|
+
declaration.kind,
|
28399
|
+
declaration.creationKeyword,
|
28400
|
+
parentGroupFlags
|
28401
|
+
);
|
28402
|
+
break;
|
28403
|
+
case 46 /* DestructorDeclaration */:
|
28404
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28405
|
+
declaration.kind,
|
28406
|
+
declaration.destructionKeyword,
|
28407
|
+
parentGroupFlags
|
28408
|
+
);
|
28409
|
+
break;
|
28410
|
+
case 47 /* IndexedElementGetterDeclaration */:
|
28411
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28412
|
+
declaration.kind,
|
28413
|
+
declaration.parameterClause,
|
28414
|
+
parentGroupFlags
|
28415
|
+
);
|
28416
|
+
break;
|
28417
|
+
case 48 /* IndexedElementSetterDeclaration */:
|
28418
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28419
|
+
declaration.kind,
|
28420
|
+
declaration.parameterClause,
|
28421
|
+
parentGroupFlags
|
28422
|
+
);
|
28423
|
+
break;
|
28424
|
+
case 50 /* DereferencedVariableGetterDeclaration */:
|
28425
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28426
|
+
declaration.kind,
|
28427
|
+
declaration.caretToken,
|
28428
|
+
parentGroupFlags
|
28429
|
+
);
|
28430
|
+
break;
|
28431
|
+
case 51 /* DereferencedVariableSetterDeclaration */:
|
28432
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28433
|
+
declaration.kind,
|
28434
|
+
declaration.caretToken,
|
28435
|
+
parentGroupFlags
|
28436
|
+
);
|
28437
|
+
break;
|
28438
|
+
case 52 /* MethodDeclaration */:
|
28439
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28440
|
+
declaration.kind,
|
28441
|
+
declaration.name,
|
28442
|
+
parentGroupFlags
|
28443
|
+
);
|
28444
|
+
break;
|
28445
|
+
case 53 /* OperatorDeclaration */:
|
28446
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28447
|
+
declaration.kind,
|
28448
|
+
declaration.name,
|
28449
|
+
parentGroupFlags
|
28450
|
+
);
|
28451
|
+
break;
|
28452
|
+
case 54 /* FieldDeclaration */:
|
28453
|
+
this.validateFieldCanBePlacedInGroupWithModifiers(
|
28454
|
+
declaration,
|
28455
|
+
declarationWithMembersKind,
|
28456
|
+
parentGroupFlags
|
28457
|
+
);
|
28458
|
+
break;
|
28459
|
+
case 55 /* FieldGetterDeclaration */:
|
28460
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28461
|
+
declaration.kind,
|
28462
|
+
declaration.name,
|
28463
|
+
parentGroupFlags
|
28464
|
+
);
|
28465
|
+
break;
|
28466
|
+
case 56 /* FieldSetterDeclaration */:
|
28467
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28468
|
+
declaration.kind,
|
28469
|
+
declaration.name,
|
28470
|
+
parentGroupFlags
|
28471
|
+
);
|
28472
|
+
break;
|
28473
|
+
case 57 /* InvalidTypeMemberDeclaration */:
|
28474
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28475
|
+
declaration.kind,
|
28476
|
+
declaration,
|
28477
|
+
parentGroupFlags
|
28478
|
+
);
|
28479
|
+
break;
|
28480
|
+
case 142 /* VariantDeclaration */:
|
28481
|
+
this.validateTypeMemberCanBePlacedInGroupWithModifiers(
|
28482
|
+
declaration.kind,
|
28483
|
+
declaration.name,
|
28484
|
+
parentGroupFlags
|
28485
|
+
);
|
28486
|
+
break;
|
28487
|
+
default:
|
28488
|
+
Debug.never(declaration);
|
28489
|
+
}
|
28490
|
+
} finally {
|
28491
|
+
this.effectiveModifiers.pop();
|
28412
28492
|
}
|
28413
28493
|
}
|
28414
28494
|
}
|
@@ -28426,9 +28506,15 @@ var ModifierValidator = class _ModifierValidator {
|
|
28426
28506
|
modifier
|
28427
28507
|
));
|
28428
28508
|
} else if ((flag & 3 /* HiddenInTypeOrWithoutLevel */) !== 0 && (flags & 64 /* Abstract */) !== 0) {
|
28429
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28509
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28510
|
+
modifier,
|
28511
|
+
this.findModifier(64 /* Abstract */)
|
28512
|
+
);
|
28430
28513
|
} else if ((flag & 3 /* HiddenInTypeOrWithoutLevel */) !== 0 && (flags & 128 /* Basic */) !== 0) {
|
28431
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28514
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28515
|
+
modifier,
|
28516
|
+
this.findModifier(128 /* Basic */)
|
28517
|
+
);
|
28432
28518
|
}
|
28433
28519
|
flags |= flag;
|
28434
28520
|
break;
|
@@ -28447,13 +28533,18 @@ var ModifierValidator = class _ModifierValidator {
|
|
28447
28533
|
} else if ((flags & 3 /* HiddenInTypeOrWithoutLevel */) !== 0) {
|
28448
28534
|
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28449
28535
|
modifier,
|
28450
|
-
|
28451
|
-
51 /* InType */
|
28536
|
+
this.findModifier(3 /* HiddenInTypeOrWithoutLevel */)
|
28452
28537
|
);
|
28453
28538
|
} else if ((flags & 32 /* Static */) !== 0) {
|
28454
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28539
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28540
|
+
modifier,
|
28541
|
+
this.findModifier(32 /* Static */)
|
28542
|
+
);
|
28455
28543
|
} else if ((flags & 128 /* Basic */) !== 0) {
|
28456
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28544
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28545
|
+
modifier,
|
28546
|
+
this.findModifier(128 /* Basic */)
|
28547
|
+
);
|
28457
28548
|
}
|
28458
28549
|
flags |= flag;
|
28459
28550
|
break;
|
@@ -28482,13 +28573,18 @@ var ModifierValidator = class _ModifierValidator {
|
|
28482
28573
|
} else if ((flags & 3 /* HiddenInTypeOrWithoutLevel */) !== 0) {
|
28483
28574
|
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28484
28575
|
modifier,
|
28485
|
-
|
28486
|
-
51 /* InType */
|
28576
|
+
this.findModifier(3 /* HiddenInTypeOrWithoutLevel */)
|
28487
28577
|
);
|
28488
28578
|
} else if ((flags & 64 /* Abstract */) !== 0) {
|
28489
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28579
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28580
|
+
modifier,
|
28581
|
+
this.findModifier(64 /* Abstract */)
|
28582
|
+
);
|
28490
28583
|
} else if ((flags & 32 /* Static */) !== 0) {
|
28491
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28584
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28585
|
+
modifier,
|
28586
|
+
this.findModifier(32 /* Static */)
|
28587
|
+
);
|
28492
28588
|
}
|
28493
28589
|
flags |= flag;
|
28494
28590
|
break;
|
@@ -28505,7 +28601,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28505
28601
|
} else if (!this.typeMemberAllowsOverrideModifier(typeMemberDeclarationKind)) {
|
28506
28602
|
this.reportModifierIsNotAllowedHere(modifier);
|
28507
28603
|
} else if ((flags & 32 /* Static */) !== 0) {
|
28508
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28604
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28605
|
+
modifier,
|
28606
|
+
this.findModifier(32 /* Static */)
|
28607
|
+
);
|
28509
28608
|
}
|
28510
28609
|
flags |= flag;
|
28511
28610
|
break;
|
@@ -28517,11 +28616,20 @@ var ModifierValidator = class _ModifierValidator {
|
|
28517
28616
|
} else if (!this.typeMemberAllowsStaticModifier(typeMemberDeclarationKind)) {
|
28518
28617
|
this.reportModifierIsNotAllowedHere(modifier);
|
28519
28618
|
} else if ((flags & 64 /* Abstract */) !== 0) {
|
28520
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28619
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28620
|
+
modifier,
|
28621
|
+
this.findModifier(64 /* Abstract */)
|
28622
|
+
);
|
28521
28623
|
} else if ((flags & 128 /* Basic */) !== 0) {
|
28522
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28624
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28625
|
+
modifier,
|
28626
|
+
this.findModifier(128 /* Basic */)
|
28627
|
+
);
|
28523
28628
|
} else if ((flags & 256 /* Override */) !== 0) {
|
28524
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28629
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28630
|
+
modifier,
|
28631
|
+
this.findModifier(256 /* Override */)
|
28632
|
+
);
|
28525
28633
|
}
|
28526
28634
|
flags |= flag;
|
28527
28635
|
break;
|
@@ -28531,7 +28639,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28531
28639
|
if ((flags & flag) !== 0) {
|
28532
28640
|
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28533
28641
|
} else if (typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ && (flags & 512 /* Async */) !== 0) {
|
28534
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28642
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28643
|
+
modifier,
|
28644
|
+
this.findModifier(512 /* Async */)
|
28645
|
+
);
|
28535
28646
|
} else if (!(typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ || typeMemberDeclarationKind === 54 /* FieldDeclaration */)) {
|
28536
28647
|
this.reportModifierIsNotAllowedHere(modifier);
|
28537
28648
|
}
|
@@ -28543,7 +28654,10 @@ var ModifierValidator = class _ModifierValidator {
|
|
28543
28654
|
if ((flags & flag) !== 0) {
|
28544
28655
|
this.reportDuplicateModifier(modifier, flag, parentGroupFlags);
|
28545
28656
|
} else if (typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ && (flags & 1024 /* Const */) !== 0) {
|
28546
|
-
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28657
|
+
this.reportModifierCanNotBeUsedWithAnotherModifier(
|
28658
|
+
modifier,
|
28659
|
+
this.findModifier(1024 /* Const */)
|
28660
|
+
);
|
28547
28661
|
} else if (!(typeMemberDeclarationKind === 44 /* TypeMemberGroupDeclaration */ || typeMemberDeclarationKind === 52 /* MethodDeclaration */)) {
|
28548
28662
|
this.reportModifierIsNotAllowedHere(modifier);
|
28549
28663
|
}
|
@@ -28562,14 +28676,18 @@ var ModifierValidator = class _ModifierValidator {
|
|
28562
28676
|
if (presentNotAllowedFlags !== 0 /* None */) {
|
28563
28677
|
this.forEachModifierFlag(
|
28564
28678
|
presentNotAllowedFlags,
|
28565
|
-
(f) =>
|
28679
|
+
(f) => {
|
28680
|
+
const modifier = this.findModifier(f);
|
28681
|
+
this.reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, modifier);
|
28682
|
+
}
|
28566
28683
|
);
|
28567
28684
|
}
|
28568
28685
|
}
|
28569
28686
|
validateFieldCanBePlacedInGroupWithModifiers(node, declarationWithMembersKind, parentGroupFlags) {
|
28570
28687
|
this.validateTypeMemberCanBePlacedInGroupWithModifiers(node.kind, node.name, parentGroupFlags);
|
28571
28688
|
if ((parentGroupFlags & 128 /* Basic */) !== 0 && declarationWithMembersKind === 2 /* AspectType */) {
|
28572
|
-
this.
|
28689
|
+
const modifier = this.findModifier(128 /* Basic */);
|
28690
|
+
this.reportDeclarationCanNotBePlacedInGroupWithModifier(node.name, modifier);
|
28573
28691
|
}
|
28574
28692
|
}
|
28575
28693
|
typeMemberAllowsAbstractModifier(kind) {
|
@@ -28589,25 +28707,34 @@ var ModifierValidator = class _ModifierValidator {
|
|
28589
28707
|
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(code, node, [this.displayModifierNode(node)]));
|
28590
28708
|
}
|
28591
28709
|
reportDuplicateHiddenModifier(node, parentGroupFlags) {
|
28592
|
-
|
28593
|
-
|
28594
|
-
|
28595
|
-
|
28596
|
-
|
28597
|
-
|
28710
|
+
let diagnostic;
|
28711
|
+
if ((parentGroupFlags & 31 /* AnyHiddenModifier */) === 0) {
|
28712
|
+
diagnostic = this._analyzer.createNodeDiagnostic(
|
28713
|
+
320 /* ModifierListAlreadyContains0Modifier */,
|
28714
|
+
node,
|
28715
|
+
[this.displayModifierNode(node, false)]
|
28716
|
+
);
|
28717
|
+
} else {
|
28718
|
+
diagnostic = this._analyzer.createNodeDiagnostic(
|
28719
|
+
321 /* ModifierListOfOuterDeclarationGroupAlreadyContains0Modifier */,
|
28720
|
+
node,
|
28721
|
+
[this.displayModifierNode(this.findModifier(31 /* AnyHiddenModifier */))]
|
28722
|
+
);
|
28723
|
+
}
|
28724
|
+
this._diagnostics.addDiagnostic(diagnostic);
|
28598
28725
|
}
|
28599
|
-
reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic,
|
28726
|
+
reportDeclarationCanNotBePlacedInGroupWithModifier(nodeForDiagnostic, modifier) {
|
28600
28727
|
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28601
28728
|
323 /* DeclarationCanNotBePlacedInGroupHaving0Modifier */,
|
28602
28729
|
nodeForDiagnostic,
|
28603
|
-
[this.
|
28730
|
+
[this.displayModifierNode(modifier)]
|
28604
28731
|
));
|
28605
28732
|
}
|
28606
|
-
reportModifierCanNotBeUsedWithAnotherModifier(firstModifier,
|
28733
|
+
reportModifierCanNotBeUsedWithAnotherModifier(firstModifier, secondModifier) {
|
28607
28734
|
this._diagnostics.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
28608
28735
|
330 /* _0ModifierCanNotBeUsedWith1Modifier */,
|
28609
28736
|
firstModifier,
|
28610
|
-
[this.displayModifierNode(firstModifier), this.
|
28737
|
+
[this.displayModifierNode(firstModifier), this.displayModifierNode(secondModifier)]
|
28611
28738
|
));
|
28612
28739
|
}
|
28613
28740
|
reportModifierIsNotAllowedHere(node) {
|
@@ -28617,52 +28744,20 @@ var ModifierValidator = class _ModifierValidator {
|
|
28617
28744
|
[this.displayModifierNode(node)]
|
28618
28745
|
));
|
28619
28746
|
}
|
28620
|
-
|
28621
|
-
|
28622
|
-
|
28623
|
-
|
28624
|
-
|
28625
|
-
|
28626
|
-
|
28627
|
-
displayModifierFlag(flag) {
|
28628
|
-
switch (flag) {
|
28629
|
-
case 1 /* HiddenWithoutLevel */:
|
28630
|
-
return this.displayModifier(37 /* Hidden */);
|
28631
|
-
case 2 /* HiddenInType */:
|
28632
|
-
return this.displayModifier(37 /* Hidden */, 51 /* InType */);
|
28633
|
-
case 4 /* HiddenInHierarchy */:
|
28634
|
-
return this.displayModifier(37 /* Hidden */, 48 /* InHierarchy */);
|
28635
|
-
case 8 /* HiddenInFile */:
|
28636
|
-
return this.displayModifier(37 /* Hidden */, 49 /* InFile */);
|
28637
|
-
case 16 /* HiddenInPackage */:
|
28638
|
-
return this.displayModifier(37 /* Hidden */, 50 /* InPackage */);
|
28639
|
-
case 128 /* Basic */:
|
28640
|
-
return this.displayModifier(17 /* Basic */);
|
28641
|
-
case 32 /* Static */:
|
28642
|
-
return this.displayModifier(41 /* Static */);
|
28643
|
-
case 64 /* Abstract */:
|
28644
|
-
return this.displayModifier(38 /* Abstract */);
|
28645
|
-
case 256 /* Override */:
|
28646
|
-
return this.displayModifier(39 /* Override */);
|
28647
|
-
case 512 /* Async */:
|
28648
|
-
return this.displayModifier(40 /* Async */);
|
28649
|
-
case 1024 /* Const */:
|
28650
|
-
return this.displayModifier(36 /* Const */);
|
28651
|
-
case 0 /* None */:
|
28652
|
-
case 2048 /* NotComputed */:
|
28653
|
-
case 31 /* AnyHiddenModifier */:
|
28654
|
-
case 17 /* HiddenInPackageOrWithoutLevel */:
|
28655
|
-
case 3 /* HiddenInTypeOrWithoutLevel */:
|
28656
|
-
return "";
|
28657
|
-
default:
|
28658
|
-
Debug.typeIsAssignableTo();
|
28659
|
-
return "";
|
28747
|
+
findModifier(modifierFlags) {
|
28748
|
+
for (const groupModifiers of this.effectiveModifiers) {
|
28749
|
+
for (const modifier of groupModifiers.modifiers) {
|
28750
|
+
if ((modifierFlags & modifierToModifierFlag(modifier)) !== 0) {
|
28751
|
+
return modifier;
|
28752
|
+
}
|
28753
|
+
}
|
28660
28754
|
}
|
28755
|
+
Debug.unreachable();
|
28661
28756
|
}
|
28662
|
-
|
28663
|
-
let result =
|
28664
|
-
if (level !== void 0) {
|
28665
|
-
result += `(${
|
28757
|
+
displayModifierNode(node, withLevel = true) {
|
28758
|
+
let result = node.value.tokens.map((t) => t.value).join(" ");
|
28759
|
+
if (withLevel && node.level !== void 0) {
|
28760
|
+
result += `(${node.level.tokens.map((t) => t.value).join(" ")})`;
|
28666
28761
|
}
|
28667
28762
|
return result;
|
28668
28763
|
}
|
@@ -43223,17 +43318,21 @@ var OverriddenMember = class {
|
|
43223
43318
|
this._overriddenAndShadowedOperators = /* @__PURE__ */ new Map();
|
43224
43319
|
this._overriddenAndShadowedIndexers = /* @__PURE__ */ new Map();
|
43225
43320
|
this._overriddenAndShadowedDereferenceOperators = /* @__PURE__ */ new Map();
|
43226
|
-
this.
|
43227
|
-
this._methodFinder = this.findOverriddenOrShadowedMethodInType.bind(this);
|
43321
|
+
this._namedMemberFinder = this.findOverriddenOrShadowedNamedMemberInType.bind(this);
|
43228
43322
|
this._operatorFinder = this.findOverriddenOrShadowedOperatorInType.bind(this);
|
43229
43323
|
this._indexerFinder = this.findOverriddenOrShadowedIndexerInType.bind(this);
|
43230
43324
|
this._dereferenceOperatorFinder = this.findOverriddenOrShadowedDereferenceOperatorInType.bind(this);
|
43325
|
+
this._isField = (m) => m.kind === "field";
|
43326
|
+
this._isMethod = (m) => m.kind === "method";
|
43327
|
+
this._isOperator = (m) => m.kind === "operator";
|
43328
|
+
this._isIndexer = (m) => m.kind === "indexer";
|
43329
|
+
this._isDereferenceOperator = (m) => m.kind === "dereference-operator";
|
43231
43330
|
}
|
43232
43331
|
getOverriddenAndShadowedFields(node) {
|
43233
43332
|
let result = this._overriddenAndShadowedFields.get(node);
|
43234
43333
|
if (result === void 0) {
|
43235
43334
|
const entity = node.kind === 54 /* FieldDeclaration */ ? this._analyzer.entity.ofFieldDeclaration(node) : this._analyzer.entity.ofComputedFieldDeclaration(node);
|
43236
|
-
result = this.findOverriddenMembers(entity, node, this.
|
43335
|
+
result = this.findOverriddenMembers(entity, node, this._isField, this._namedMemberFinder);
|
43237
43336
|
this._overriddenAndShadowedFields.set(node, result);
|
43238
43337
|
}
|
43239
43338
|
return result;
|
@@ -43242,7 +43341,7 @@ var OverriddenMember = class {
|
|
43242
43341
|
let result = this._overriddenAndShadowedMethods.get(node);
|
43243
43342
|
if (result === void 0) {
|
43244
43343
|
const entity = this._analyzer.entity.ofMethodDeclaration(node);
|
43245
|
-
result = this.findOverriddenMembers(entity, node, this.
|
43344
|
+
result = this.findOverriddenMembers(entity, node, this._isMethod, this._namedMemberFinder);
|
43246
43345
|
this._overriddenAndShadowedMethods.set(node, result);
|
43247
43346
|
}
|
43248
43347
|
return result;
|
@@ -43251,7 +43350,7 @@ var OverriddenMember = class {
|
|
43251
43350
|
let result = this._overriddenAndShadowedOperators.get(node);
|
43252
43351
|
if (result === void 0) {
|
43253
43352
|
const entity = this._analyzer.entity.ofOperatorDeclaration(node);
|
43254
|
-
result = this.findOverriddenMembers(entity, node, this._operatorFinder);
|
43353
|
+
result = this.findOverriddenMembers(entity, node, this._isOperator, this._operatorFinder);
|
43255
43354
|
this._overriddenAndShadowedOperators.set(node, result);
|
43256
43355
|
}
|
43257
43356
|
return result;
|
@@ -43260,7 +43359,7 @@ var OverriddenMember = class {
|
|
43260
43359
|
let result = this._overriddenAndShadowedIndexers.get(node);
|
43261
43360
|
if (result === void 0) {
|
43262
43361
|
const entity = this._analyzer.entity.ofIndexerDeclaration(node);
|
43263
|
-
result = this.findOverriddenMembers(entity, node, this._indexerFinder);
|
43362
|
+
result = this.findOverriddenMembers(entity, node, this._isIndexer, this._indexerFinder);
|
43264
43363
|
this._overriddenAndShadowedIndexers.set(node, result);
|
43265
43364
|
}
|
43266
43365
|
return result;
|
@@ -43269,7 +43368,7 @@ var OverriddenMember = class {
|
|
43269
43368
|
let result = this._overriddenAndShadowedDereferenceOperators.get(node);
|
43270
43369
|
if (result === void 0) {
|
43271
43370
|
const entity = this._analyzer.entity.ofDereferenceOperatorDeclaration(node);
|
43272
|
-
result = this.findOverriddenMembers(entity, node, this._dereferenceOperatorFinder);
|
43371
|
+
result = this.findOverriddenMembers(entity, node, this._isDereferenceOperator, this._dereferenceOperatorFinder);
|
43273
43372
|
this._overriddenAndShadowedDereferenceOperators.set(node, result);
|
43274
43373
|
}
|
43275
43374
|
return result;
|
@@ -43309,26 +43408,35 @@ var OverriddenMember = class {
|
|
43309
43408
|
Debug.never(member);
|
43310
43409
|
}
|
43311
43410
|
}
|
43312
|
-
findOverriddenMembers(entity, contextualNode, overriddenOrShadowedMemberFinder) {
|
43411
|
+
findOverriddenMembers(entity, contextualNode, isMemberOfCorrectKind, overriddenOrShadowedMemberFinder) {
|
43313
43412
|
const overriddenMembers = new Array();
|
43314
43413
|
const shadowedMembers = new Array();
|
43315
43414
|
if (this.entityCanOverrideOrShadow(entity)) {
|
43316
43415
|
for (const lookup of this.enumerateTypeMemberLookups(entity, contextualNode)) {
|
43317
43416
|
const overriddenOrShadowedMember = overriddenOrShadowedMemberFinder(entity, lookup);
|
43318
43417
|
if (overriddenOrShadowedMember !== void 0) {
|
43418
|
+
if (!isMemberOfCorrectKind(overriddenOrShadowedMember)) {
|
43419
|
+
if (!shadowedMembers.some((m) => m.value.equals(overriddenOrShadowedMember))) {
|
43420
|
+
shadowedMembers.push(new ShadowedMemberInfo(
|
43421
|
+
overriddenOrShadowedMember,
|
43422
|
+
0 /* BaseMemberHasDifferentKind */
|
43423
|
+
));
|
43424
|
+
}
|
43425
|
+
continue;
|
43426
|
+
}
|
43319
43427
|
const overriddenOrShadowedMemberEntity = overriddenOrShadowedMember.getEntity();
|
43320
43428
|
let shadowReason;
|
43321
43429
|
if (!this.entityCanBeOverridden(overriddenOrShadowedMemberEntity)) {
|
43322
|
-
shadowReason =
|
43430
|
+
shadowReason = 1 /* BaseMemberCanNotBeOverridden */;
|
43323
43431
|
} else if (!entity.isOverride() && !TypeMemberEntity.isAbstract(overriddenOrShadowedMember.getEntity())) {
|
43324
|
-
shadowReason =
|
43432
|
+
shadowReason = 2 /* NoOverrideModifier */;
|
43325
43433
|
}
|
43326
|
-
if (shadowReason === void 0 || shadowReason ===
|
43434
|
+
if (shadowReason === void 0 || shadowReason === 2 /* NoOverrideModifier */) {
|
43327
43435
|
const overridingType = this.getEntityTypeOrReturnType(entity);
|
43328
43436
|
const overriddenType = this.getMemberTypeOrReturnType(overriddenOrShadowedMember);
|
43329
43437
|
const typeAssignabilityFlags = this._analyzer.getTypeAssignabilityFlags(overridingType, overriddenType);
|
43330
43438
|
if ((typeAssignabilityFlags & (1 /* NotAssignable */ | 16 /* ImplicitConversion */)) !== 0) {
|
43331
|
-
shadowReason = shadowReason ===
|
43439
|
+
shadowReason = shadowReason === 2 /* NoOverrideModifier */ ? 3 /* NoOverrideModifierAndTypeOrReturnTypeMismatch */ : 4 /* TypeOrReturnTypeMismatch */;
|
43332
43440
|
}
|
43333
43441
|
}
|
43334
43442
|
if (shadowReason === void 0) {
|
@@ -43345,14 +43453,16 @@ var OverriddenMember = class {
|
|
43345
43453
|
}
|
43346
43454
|
return new OverriddenAndShadowedMembers(overriddenMembers, shadowedMembers);
|
43347
43455
|
}
|
43348
|
-
|
43456
|
+
findOverriddenOrShadowedNamedMemberInType(entity, typeMemberLookup) {
|
43349
43457
|
return typeMemberLookup.getNamedMembersByName(new SearchName(
|
43350
|
-
|
43351
|
-
(
|
43352
|
-
)).find((m) =>
|
43353
|
-
|
43354
|
-
|
43355
|
-
|
43458
|
+
entity.getName(),
|
43459
|
+
(entity.getName().flags & 2 /* OriginalName */) !== 0
|
43460
|
+
)).find((m) => {
|
43461
|
+
if (entity.kind === 1 /* Function */ && m.value.kind === "method") {
|
43462
|
+
return this.checkMethodOverridesOrShadowsMethod(entity, m.value);
|
43463
|
+
}
|
43464
|
+
return true;
|
43465
|
+
})?.value;
|
43356
43466
|
}
|
43357
43467
|
findOverriddenOrShadowedOperatorInType(operator, typeMemberLookup) {
|
43358
43468
|
return typeMemberLookup.getOperatorsByKind(operator.getOperatorKind()).find((o) => this.checkOperatorOverridesOrShadowsOperator(operator, o.value))?.value;
|
@@ -43443,10 +43553,11 @@ var OverriddenMember = class {
|
|
43443
43553
|
}
|
43444
43554
|
};
|
43445
43555
|
var ShadowReason = /* @__PURE__ */ ((ShadowReason2) => {
|
43446
|
-
ShadowReason2[ShadowReason2["
|
43447
|
-
ShadowReason2[ShadowReason2["
|
43448
|
-
ShadowReason2[ShadowReason2["
|
43449
|
-
ShadowReason2[ShadowReason2["
|
43556
|
+
ShadowReason2[ShadowReason2["BaseMemberHasDifferentKind"] = 0] = "BaseMemberHasDifferentKind";
|
43557
|
+
ShadowReason2[ShadowReason2["BaseMemberCanNotBeOverridden"] = 1] = "BaseMemberCanNotBeOverridden";
|
43558
|
+
ShadowReason2[ShadowReason2["NoOverrideModifier"] = 2] = "NoOverrideModifier";
|
43559
|
+
ShadowReason2[ShadowReason2["NoOverrideModifierAndTypeOrReturnTypeMismatch"] = 3] = "NoOverrideModifierAndTypeOrReturnTypeMismatch";
|
43560
|
+
ShadowReason2[ShadowReason2["TypeOrReturnTypeMismatch"] = 4] = "TypeOrReturnTypeMismatch";
|
43450
43561
|
return ShadowReason2;
|
43451
43562
|
})(ShadowReason || {});
|
43452
43563
|
var ShadowedMemberInfo = class {
|
@@ -44088,7 +44199,7 @@ var TypeAssignabilityCheck = class {
|
|
44088
44199
|
}
|
44089
44200
|
isTypeAssignableTo(source, target) {
|
44090
44201
|
const assignabilityFlags = this.getAssignabilityFlags(source, target);
|
44091
|
-
return assignabilityFlags
|
44202
|
+
return (assignabilityFlags & 1 /* NotAssignable */) === 0;
|
44092
44203
|
}
|
44093
44204
|
getAssignabilityFlags(source, target) {
|
44094
44205
|
source = unaliasType(source);
|
@@ -44113,7 +44224,7 @@ var TypeAssignabilityCheck = class {
|
|
44113
44224
|
}
|
44114
44225
|
}
|
44115
44226
|
if (source.kind === "union") {
|
44116
|
-
let result =
|
44227
|
+
let result = 0 /* None */;
|
44117
44228
|
for (const type of source.unaliasedFlattenedTypes) {
|
44118
44229
|
const constituentTypeResult = this.getAssignabilityFlags(type, target);
|
44119
44230
|
if (constituentTypeResult === 1 /* NotAssignable */) {
|
@@ -44122,30 +44233,39 @@ var TypeAssignabilityCheck = class {
|
|
44122
44233
|
}
|
44123
44234
|
result |= constituentTypeResult;
|
44124
44235
|
}
|
44236
|
+
if (result === 0 /* None */) {
|
44237
|
+
result = 2 /* Identity */;
|
44238
|
+
}
|
44125
44239
|
return result;
|
44126
44240
|
}
|
44127
44241
|
if (target.kind === "union") {
|
44128
|
-
let result =
|
44242
|
+
let result = 0 /* None */;
|
44129
44243
|
for (const type of target.unaliasedFlattenedTypes) {
|
44130
44244
|
const constituentTypeResult = this.getAssignabilityFlags(source, type);
|
44131
44245
|
if (this.areNewFlagsBetter(result, constituentTypeResult)) {
|
44132
44246
|
result = constituentTypeResult;
|
44133
44247
|
}
|
44134
44248
|
}
|
44249
|
+
if (result === 0 /* None */) {
|
44250
|
+
result = 2 /* Identity */;
|
44251
|
+
}
|
44135
44252
|
return result;
|
44136
44253
|
}
|
44137
44254
|
if (source.kind === "intersection") {
|
44138
|
-
let result =
|
44255
|
+
let result = 0 /* None */;
|
44139
44256
|
for (const type of source.unaliasedFlattenedTypes) {
|
44140
44257
|
const constituentTypeResult = this.getAssignabilityFlags(type, target);
|
44141
44258
|
if (this.areNewFlagsBetter(result, constituentTypeResult)) {
|
44142
44259
|
result = constituentTypeResult;
|
44143
44260
|
}
|
44144
44261
|
}
|
44262
|
+
if (result === 0 /* None */) {
|
44263
|
+
result = 2 /* Identity */;
|
44264
|
+
}
|
44145
44265
|
return result;
|
44146
44266
|
}
|
44147
44267
|
if (target.kind === "intersection") {
|
44148
|
-
let result =
|
44268
|
+
let result = 0 /* None */;
|
44149
44269
|
for (const type of target.unaliasedFlattenedTypes) {
|
44150
44270
|
const constituentTypeResult = this.getAssignabilityFlags(source, type);
|
44151
44271
|
if (constituentTypeResult === 1 /* NotAssignable */) {
|
@@ -44154,6 +44274,9 @@ var TypeAssignabilityCheck = class {
|
|
44154
44274
|
}
|
44155
44275
|
result |= constituentTypeResult;
|
44156
44276
|
}
|
44277
|
+
if (result === 0 /* None */) {
|
44278
|
+
result = 2 /* Identity */;
|
44279
|
+
}
|
44157
44280
|
return result;
|
44158
44281
|
}
|
44159
44282
|
if (source.equals(this._analyzer.standardTypes.none) || target.equals(this._analyzer.standardTypes.none)) {
|
@@ -44239,7 +44362,7 @@ var TypeAssignabilityCheck = class {
|
|
44239
44362
|
if (newFlags === currentFlags) {
|
44240
44363
|
return false;
|
44241
44364
|
}
|
44242
|
-
if (currentFlags === 1 /* NotAssignable */) {
|
44365
|
+
if (currentFlags === 0 /* None */ || currentFlags === 1 /* NotAssignable */) {
|
44243
44366
|
return true;
|
44244
44367
|
}
|
44245
44368
|
const currentLowestScore = this.getLowestFlagsScore(currentFlags);
|
@@ -44253,9 +44376,11 @@ var TypeAssignabilityCheck = class {
|
|
44253
44376
|
}
|
44254
44377
|
}
|
44255
44378
|
getLowestFlagsScore(flags) {
|
44379
|
+
if (flags === 0 /* None */) {
|
44380
|
+
return 0;
|
44381
|
+
}
|
44256
44382
|
let lowestScore = Number.MAX_SAFE_INTEGER;
|
44257
|
-
let current = 1 /* First */;
|
44258
|
-
while (current <= 16 /* Last */) {
|
44383
|
+
for (let current = 1 /* First */; current <= 16 /* Last */; current <<= 1) {
|
44259
44384
|
if ((flags & current) !== 0) {
|
44260
44385
|
const score = this.getSingleFlagScore(current);
|
44261
44386
|
if (score < lowestScore) {
|
@@ -44265,18 +44390,15 @@ var TypeAssignabilityCheck = class {
|
|
44265
44390
|
break;
|
44266
44391
|
}
|
44267
44392
|
}
|
44268
|
-
current <<= 1;
|
44269
44393
|
}
|
44270
44394
|
return lowestScore;
|
44271
44395
|
}
|
44272
44396
|
getFlagCount(flags) {
|
44273
44397
|
let result = 0;
|
44274
|
-
let current = 1 /* First */;
|
44275
|
-
while (current <= 16 /* Last */) {
|
44398
|
+
for (let current = 1 /* First */; current <= 16 /* Last */; current <<= 1) {
|
44276
44399
|
if ((flags & current) !== 0) {
|
44277
44400
|
result++;
|
44278
44401
|
}
|
44279
|
-
current <<= 1;
|
44280
44402
|
}
|
44281
44403
|
return result;
|
44282
44404
|
}
|
@@ -46367,104 +46489,57 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
46367
46489
|
}
|
46368
46490
|
}
|
46369
46491
|
checkPackageMemberBodyPresence(entity, body, nodeForDiagnostics) {
|
46370
|
-
const bodyRequirementReason = this.getPackageMemberBodyRequirementReason(entity);
|
46371
|
-
switch (bodyRequirementReason) {
|
46372
|
-
case 0 /* DoesNotRequireBecauseIsDeclaredInInterfacePackage */:
|
46373
|
-
if (body !== void 0) {
|
46374
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46375
|
-
248 /* InterfacePackageMustNotContainImplementation */,
|
46376
|
-
nodeForDiagnostics
|
46377
|
-
));
|
46378
|
-
}
|
46379
|
-
break;
|
46380
|
-
case 1 /* DoesNotRequireBecauseHasBuiltIntoPlatformTag */:
|
46381
|
-
if (body !== void 0) {
|
46382
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46383
|
-
254 /* DeclarationsMarkedWithBuiltIntoPlatformTagMustNotHaveBody */,
|
46384
|
-
nodeForDiagnostics
|
46385
|
-
));
|
46386
|
-
}
|
46387
|
-
break;
|
46388
|
-
case 2 /* RequiresBecauseIsRegularMember */:
|
46389
|
-
if (body === void 0) {
|
46390
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
46391
|
-
}
|
46392
|
-
break;
|
46393
|
-
default:
|
46394
|
-
Debug.never(bodyRequirementReason);
|
46395
|
-
}
|
46396
|
-
}
|
46397
|
-
getPackageMemberBodyRequirementReason(entity) {
|
46398
46492
|
if (this.isInterfacePackageFile) {
|
46399
|
-
|
46400
|
-
|
46401
|
-
|
46402
|
-
|
46403
|
-
|
46404
|
-
|
46405
|
-
|
46406
|
-
|
46407
|
-
|
46408
|
-
|
46409
|
-
|
46410
|
-
|
46411
|
-
|
46412
|
-
|
46413
|
-
|
46414
|
-
|
46415
|
-
}
|
46416
|
-
break;
|
46417
|
-
case 1 /* DoesNotRequireBecauseIsAbstract */:
|
46418
|
-
if (body !== void 0) {
|
46419
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46420
|
-
251 /* AbstractTypeMembersMustNotHaveBody */,
|
46421
|
-
nodeForDiagnostics
|
46422
|
-
));
|
46423
|
-
}
|
46424
|
-
break;
|
46425
|
-
case 3 /* DoesNotRequireBecauseHasBuiltIntoPlatformTag */:
|
46426
|
-
if (body !== void 0) {
|
46427
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46428
|
-
254 /* DeclarationsMarkedWithBuiltIntoPlatformTagMustNotHaveBody */,
|
46429
|
-
nodeForDiagnostics
|
46430
|
-
));
|
46431
|
-
}
|
46432
|
-
break;
|
46433
|
-
case 2 /* DoesNotRequireBecauseIsAspectTypeMember */: {
|
46434
|
-
if (body !== void 0) {
|
46435
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46436
|
-
252 /* MembersOfAspectTypeMustNotHaveBody */,
|
46437
|
-
nodeForDiagnostics
|
46438
|
-
));
|
46439
|
-
}
|
46440
|
-
break;
|
46493
|
+
if (body !== void 0) {
|
46494
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46495
|
+
248 /* InterfacePackageMustNotContainImplementation */,
|
46496
|
+
nodeForDiagnostics
|
46497
|
+
));
|
46498
|
+
}
|
46499
|
+
} else if (findTag(this._analyzer.wellKnownDeclarations.builtIntoPlatform, entity.getTags()) !== void 0) {
|
46500
|
+
if (body !== void 0) {
|
46501
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46502
|
+
254 /* DeclarationsMarkedWithBuiltIntoPlatformTagMustNotHaveBody */,
|
46503
|
+
nodeForDiagnostics
|
46504
|
+
));
|
46505
|
+
}
|
46506
|
+
} else {
|
46507
|
+
if (body === void 0) {
|
46508
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
46441
46509
|
}
|
46442
|
-
case 4 /* RequiresBecauseIsBasicAspectTypeMember */:
|
46443
|
-
case 5 /* RequiresBecauseIsHiddenAspectTypeMember */:
|
46444
|
-
case 7 /* RequiresBecauseIsRegularMember */:
|
46445
|
-
case 6 /* RequiresBecauseIsStaticMember */:
|
46446
|
-
if (body === void 0) {
|
46447
|
-
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
46448
|
-
}
|
46449
|
-
break;
|
46450
|
-
default:
|
46451
|
-
Debug.never(bodyRequirementReason);
|
46452
46510
|
}
|
46453
46511
|
}
|
46454
|
-
|
46512
|
+
checkTypeMemberBodyPresence(entity, body, nodeForDiagnostics) {
|
46455
46513
|
if (this.isInterfacePackageFile) {
|
46456
|
-
|
46457
|
-
|
46458
|
-
|
46459
|
-
|
46460
|
-
|
46461
|
-
|
46462
|
-
|
46463
|
-
|
46464
|
-
|
46465
|
-
|
46514
|
+
if (body !== void 0) {
|
46515
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46516
|
+
248 /* InterfacePackageMustNotContainImplementation */,
|
46517
|
+
nodeForDiagnostics
|
46518
|
+
));
|
46519
|
+
}
|
46520
|
+
} else if (findTag(this._analyzer.wellKnownDeclarations.builtIntoPlatform, entity.getTags()) !== void 0) {
|
46521
|
+
if (body !== void 0) {
|
46522
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46523
|
+
254 /* DeclarationsMarkedWithBuiltIntoPlatformTagMustNotHaveBody */,
|
46524
|
+
nodeForDiagnostics
|
46525
|
+
));
|
46526
|
+
}
|
46527
|
+
} else if (TypeMemberEntity.isStatic(entity)) {
|
46528
|
+
if (body === void 0) {
|
46529
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
46530
|
+
}
|
46531
|
+
} else if (entity.markedAbstract()) {
|
46532
|
+
if (body !== void 0) {
|
46533
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
46534
|
+
251 /* AbstractTypeMembersMustNotHaveBody */,
|
46535
|
+
nodeForDiagnostics
|
46536
|
+
));
|
46537
|
+
}
|
46538
|
+
} else {
|
46539
|
+
if (body === void 0) {
|
46540
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(250 /* BodyIsMissing */, nodeForDiagnostics));
|
46541
|
+
}
|
46466
46542
|
}
|
46467
|
-
return 7 /* RequiresBecauseIsRegularMember */;
|
46468
46543
|
}
|
46469
46544
|
// TODO: учесть константы времени компиляции.
|
46470
46545
|
// private validateVariantInitializer(expression: tree.Expression): void {
|
@@ -47195,7 +47270,15 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
47195
47270
|
continue;
|
47196
47271
|
}
|
47197
47272
|
switch (shadowedMember.shadowReason) {
|
47198
|
-
case 0 /*
|
47273
|
+
case 0 /* BaseMemberHasDifferentKind */: {
|
47274
|
+
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
47275
|
+
338 /* DeclarationConflictsWithBaseTypeMember0 */,
|
47276
|
+
nodeForDiagnostic,
|
47277
|
+
[this._displayService.displayTypeMember(shadowedMember.value)]
|
47278
|
+
));
|
47279
|
+
break;
|
47280
|
+
}
|
47281
|
+
case 1 /* BaseMemberCanNotBeOverridden */: {
|
47199
47282
|
if (entity.isOverride()) {
|
47200
47283
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
47201
47284
|
340 /* DeclarationConflictsWithBaseTypeMember0ThisMemberCanNotBeOverridden */,
|
@@ -47211,7 +47294,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
47211
47294
|
}
|
47212
47295
|
break;
|
47213
47296
|
}
|
47214
|
-
case
|
47297
|
+
case 2 /* NoOverrideModifier */: {
|
47215
47298
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
47216
47299
|
339 /* DeclarationConflictsWithBaseTypeMember0AddOverrideModifier */,
|
47217
47300
|
nodeForDiagnostic,
|
@@ -47219,7 +47302,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
47219
47302
|
));
|
47220
47303
|
break;
|
47221
47304
|
}
|
47222
|
-
case
|
47305
|
+
case 4 /* TypeOrReturnTypeMismatch */: {
|
47223
47306
|
const diagnosticCode = entity.kind === 0 /* Variable */ ? 341 /* DeclarationConflictsWithBaseTypeMember0ToOverrideTypeMustBeAssignableTo1 */ : 342 /* DeclarationConflictsWithBaseTypeMember0ToOverrideReturnTypeMustBeAssignableTo1 */;
|
47224
47307
|
const type = this._analyzer.overriddenMember.getMemberTypeOrReturnType(shadowedMember.value);
|
47225
47308
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
@@ -47229,7 +47312,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
47229
47312
|
));
|
47230
47313
|
break;
|
47231
47314
|
}
|
47232
|
-
case
|
47315
|
+
case 3 /* NoOverrideModifierAndTypeOrReturnTypeMismatch */:
|
47233
47316
|
this.addDiagnostic(this._analyzer.createNodeDiagnostic(
|
47234
47317
|
338 /* DeclarationConflictsWithBaseTypeMember0 */,
|
47235
47318
|
nodeForDiagnostic,
|
@@ -53032,22 +53115,22 @@ var MethodDeclaration3 = class _MethodDeclaration {
|
|
53032
53115
|
}
|
53033
53116
|
};
|
53034
53117
|
var FieldAccessExpression = class _FieldAccessExpression {
|
53035
|
-
constructor(expression, isOptionalAccess,
|
53118
|
+
constructor(expression, isOptionalAccess, field, accessKind, ifComputedThenKey, sourceLocation, options = FieldAccessExpressionEmitOptions.default()) {
|
53036
53119
|
this.expression = expression;
|
53037
53120
|
this.isOptionalAccess = isOptionalAccess;
|
53038
|
-
this.
|
53121
|
+
this.field = field;
|
53039
53122
|
this.accessKind = accessKind;
|
53040
53123
|
this.ifComputedThenKey = ifComputedThenKey;
|
53041
53124
|
this.sourceLocation = sourceLocation;
|
53042
53125
|
this.options = options;
|
53043
53126
|
this.kind = 69 /* FieldAccessExpression */;
|
53044
53127
|
}
|
53045
|
-
static get(expression, isOptionalAccess,
|
53128
|
+
static get(expression, isOptionalAccess, field, ifComputedThenKey, sourceLocation) {
|
53046
53129
|
let accessedVariable;
|
53047
|
-
if (
|
53048
|
-
accessedVariable =
|
53130
|
+
if (field instanceof AccessedVariable) {
|
53131
|
+
accessedVariable = field;
|
53049
53132
|
} else {
|
53050
|
-
accessedVariable = AccessedVariable.fromEntity(
|
53133
|
+
accessedVariable = AccessedVariable.fromEntity(field);
|
53051
53134
|
}
|
53052
53135
|
return new _FieldAccessExpression(
|
53053
53136
|
expression,
|
@@ -53058,12 +53141,12 @@ var FieldAccessExpression = class _FieldAccessExpression {
|
|
53058
53141
|
sourceLocation
|
53059
53142
|
);
|
53060
53143
|
}
|
53061
|
-
static set(expression, isOptionalAccess,
|
53144
|
+
static set(expression, isOptionalAccess, field, ifComputedThenKey, sourceLocation) {
|
53062
53145
|
let accessedVariable;
|
53063
|
-
if (
|
53064
|
-
accessedVariable =
|
53146
|
+
if (field instanceof AccessedVariable) {
|
53147
|
+
accessedVariable = field;
|
53065
53148
|
} else {
|
53066
|
-
accessedVariable = AccessedVariable.fromEntity(
|
53149
|
+
accessedVariable = AccessedVariable.fromEntity(field);
|
53067
53150
|
}
|
53068
53151
|
return new _FieldAccessExpression(
|
53069
53152
|
expression,
|
@@ -53078,7 +53161,7 @@ var FieldAccessExpression = class _FieldAccessExpression {
|
|
53078
53161
|
return new _FieldAccessExpression(
|
53079
53162
|
this.expression.clone(),
|
53080
53163
|
this.isOptionalAccess,
|
53081
|
-
this.
|
53164
|
+
this.field,
|
53082
53165
|
this.accessKind,
|
53083
53166
|
this.ifComputedThenKey?.clone(),
|
53084
53167
|
this.sourceLocation,
|
@@ -53394,7 +53477,7 @@ var TypeUtils2 = class {
|
|
53394
53477
|
case 66 /* FunctionAccessExpression */:
|
53395
53478
|
return this._ectx.standardTypes.func;
|
53396
53479
|
case 69 /* FieldAccessExpression */:
|
53397
|
-
return expression.
|
53480
|
+
return expression.field.type;
|
53398
53481
|
case 70 /* MethodAccessExpression */:
|
53399
53482
|
return this._ectx.standardTypes.func;
|
53400
53483
|
case 71 /* ConstructorCallExpression */:
|
@@ -55774,22 +55857,29 @@ var GeneralLoweringContext = class {
|
|
55774
55857
|
generateId() {
|
55775
55858
|
return this._id++;
|
55776
55859
|
}
|
55777
|
-
|
55778
|
-
|
55779
|
-
|
55780
|
-
|
55781
|
-
)
|
55782
|
-
|
55783
|
-
|
55784
|
-
|
55785
|
-
|
55786
|
-
|
55787
|
-
|
55788
|
-
|
55789
|
-
new
|
55790
|
-
|
55791
|
-
|
55792
|
-
|
55860
|
+
createCachingTemporaryVariable(initializer, containingPackage, tempVariables) {
|
55861
|
+
let tempVariable;
|
55862
|
+
let assignment;
|
55863
|
+
let access;
|
55864
|
+
if (this.isExpressionThatDoesNotNeedToBeCached(initializer)) {
|
55865
|
+
access = initializer;
|
55866
|
+
} else {
|
55867
|
+
tempVariable = this.createUniqueLocalVariableEntity(
|
55868
|
+
containingPackage,
|
55869
|
+
this.ectx.type.ofExpression(initializer)
|
55870
|
+
);
|
55871
|
+
tempVariables?.push(tempVariable);
|
55872
|
+
assignment = new AssignmentExpression(
|
55873
|
+
VariableAccessExpression.get(tempVariable),
|
55874
|
+
0 /* Equals */,
|
55875
|
+
initializer,
|
55876
|
+
void 0,
|
55877
|
+
void 0,
|
55878
|
+
new AssignmentEmitOptions(false, false, false)
|
55879
|
+
);
|
55880
|
+
access = VariableAccessExpression.get(tempVariable);
|
55881
|
+
}
|
55882
|
+
return [tempVariable, assignment, access];
|
55793
55883
|
}
|
55794
55884
|
getBinaryExpressionOperatorFromAssignmentOperator(operator) {
|
55795
55885
|
switch (operator) {
|
@@ -56015,17 +56105,29 @@ var GeneralLoweringContext = class {
|
|
56015
56105
|
return false;
|
56016
56106
|
}
|
56017
56107
|
}
|
56108
|
+
isPossiblyCastedBaseExpression(node) {
|
56109
|
+
return this.ifPossiblyCastedBaseExpressionThenExpression(node) !== void 0;
|
56110
|
+
}
|
56111
|
+
ifPossiblyCastedBaseExpressionThenExpression(node) {
|
56112
|
+
if (node.kind === 0 /* AsExpression */) {
|
56113
|
+
node = node.expression;
|
56114
|
+
}
|
56115
|
+
if (node.kind === 89 /* BaseExpression */) {
|
56116
|
+
return node;
|
56117
|
+
}
|
56118
|
+
return void 0;
|
56119
|
+
}
|
56018
56120
|
createMemberAccessWithNullCheck(receiver, createMemberAccess, tempVariables, containingPackage) {
|
56019
56121
|
let result;
|
56020
56122
|
if (this.isOptionalChaining(receiver)) {
|
56021
|
-
const [, tempVariableAssignment, tempVariableAccess] = this.
|
56123
|
+
const [, tempVariableAssignment, tempVariableAccess] = this.createCachingTemporaryVariable(
|
56022
56124
|
receiver,
|
56023
56125
|
containingPackage,
|
56024
56126
|
tempVariables
|
56025
56127
|
);
|
56026
56128
|
const substitutionMemberAccess = createMemberAccess(tempVariableAccess);
|
56027
56129
|
const isEmptyExpression = new BinaryExpression3(
|
56028
|
-
tempVariableAssignment,
|
56130
|
+
tempVariableAssignment ?? tempVariableAccess,
|
56029
56131
|
5 /* Equals */,
|
56030
56132
|
new NoneLiteral(void 0),
|
56031
56133
|
this.ectx.standardTypes.yesNo,
|
@@ -56045,6 +56147,23 @@ var GeneralLoweringContext = class {
|
|
56045
56147
|
}
|
56046
56148
|
return result;
|
56047
56149
|
}
|
56150
|
+
isExpressionThatDoesNotNeedToBeCached(node) {
|
56151
|
+
switch (node.kind) {
|
56152
|
+
case 58 /* ThisExpression */:
|
56153
|
+
case 89 /* BaseExpression */:
|
56154
|
+
case 64 /* TypeAccessExpression */:
|
56155
|
+
case 6 /* BooleanLiteral */:
|
56156
|
+
case 31 /* IntegerLiteral */:
|
56157
|
+
case 37 /* NumericLiteral */:
|
56158
|
+
return true;
|
56159
|
+
case 65 /* VariableAccessExpression */: {
|
56160
|
+
const entity = node.variable.entity;
|
56161
|
+
return !entity.isPackageMember && entity.ifTypeMemberThenContainingType === void 0;
|
56162
|
+
}
|
56163
|
+
default:
|
56164
|
+
return false;
|
56165
|
+
}
|
56166
|
+
}
|
56048
56167
|
createUniqueLocalVariableEntity(containingPackage, type) {
|
56049
56168
|
const name = EmitPhaseName.ofTempVariable(containingPackage.locale, this.generateId());
|
56050
56169
|
return new IntrinsicVariableEntity(name, type, containingPackage);
|
@@ -56087,8 +56206,8 @@ var ExecutableCodeLowering = class {
|
|
56087
56206
|
this._ctx = _ctx;
|
56088
56207
|
this._packageEntity = _packageEntity;
|
56089
56208
|
}
|
56090
|
-
|
56091
|
-
return this._ctx.
|
56209
|
+
createCachingTemporaryVariable(initializer, tempVariables) {
|
56210
|
+
return this._ctx.createCachingTemporaryVariable(initializer, this._packageEntity, tempVariables);
|
56092
56211
|
}
|
56093
56212
|
createMemberAccessWithNullCheck(receiver, tempVariables, createMemberAccess) {
|
56094
56213
|
return this._ctx.createMemberAccessWithNullCheck(receiver, createMemberAccess, tempVariables, this._packageEntity);
|
@@ -56898,7 +57017,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
56898
57017
|
return void 0;
|
56899
57018
|
}
|
56900
57019
|
tryLowerFieldAccessExpression(node) {
|
56901
|
-
const entity = node.
|
57020
|
+
const entity = node.field.entity;
|
56902
57021
|
if (entity.getter?.details.isAliasTypeOrExtensionMemberThatRequiresLowering === true) {
|
56903
57022
|
const { expression, tempVariables } = this.lowerComputedVariableGetAccess(node);
|
56904
57023
|
return replaceExpression(expression, tempVariables);
|
@@ -56907,7 +57026,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
56907
57026
|
}
|
56908
57027
|
tryLowerAssignmentStatement(node) {
|
56909
57028
|
if (node.left.kind === 69 /* FieldAccessExpression */) {
|
56910
|
-
const entity = node.left.
|
57029
|
+
const entity = node.left.field.entity;
|
56911
57030
|
if (entity.setter?.details.isAliasTypeOrExtensionMemberThatRequiresLowering === true) {
|
56912
57031
|
const { statement, tempVariables } = this.lowerComputedVariableSetAccess(node);
|
56913
57032
|
return replaceStatement(statement, tempVariables);
|
@@ -56920,12 +57039,16 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
56920
57039
|
Debug.assert(callee.kind === 70 /* MethodAccessExpression */);
|
56921
57040
|
const args = this._ctx.getOrderedArguments(node.args);
|
56922
57041
|
const tempVariables = new Array();
|
57042
|
+
let receiver = callee.expression;
|
57043
|
+
if (this._ctx.isPossiblyCastedBaseExpression(receiver)) {
|
57044
|
+
receiver = new ThisExpression(this._ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
57045
|
+
}
|
56923
57046
|
const expression = this.createMemberAccessWithNullCheck(
|
56924
|
-
|
57047
|
+
receiver,
|
56925
57048
|
tempVariables,
|
56926
|
-
(
|
57049
|
+
(nonEmptyReceiver) => this.createCallOfMethodWithExplicitReceiver(
|
56927
57050
|
callee.method.entity,
|
56928
|
-
|
57051
|
+
nonEmptyReceiver,
|
56929
57052
|
args,
|
56930
57053
|
node.returnType
|
56931
57054
|
)
|
@@ -56958,18 +57081,22 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
56958
57081
|
}
|
56959
57082
|
lowerComputedVariableGetAccess(node) {
|
56960
57083
|
Debug.assert(node.accessKind === 0 /* Get */);
|
56961
|
-
const getter = node.
|
57084
|
+
const getter = node.field.entity.getter;
|
56962
57085
|
Debug.assertNotNull(getter);
|
56963
57086
|
const args = new OrderedArguments([], false);
|
56964
57087
|
const tempVariables = new Array();
|
57088
|
+
let receiver = node.expression;
|
57089
|
+
if (this._ctx.isPossiblyCastedBaseExpression(receiver)) {
|
57090
|
+
receiver = new ThisExpression(this._ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
57091
|
+
}
|
56965
57092
|
const expression = this.createMemberAccessWithNullCheck(
|
56966
|
-
|
57093
|
+
receiver,
|
56967
57094
|
tempVariables,
|
56968
|
-
(
|
57095
|
+
(nonEmptyReceiver) => this.createCallOfMethodWithExplicitReceiver(
|
56969
57096
|
getter,
|
56970
|
-
|
57097
|
+
nonEmptyReceiver,
|
56971
57098
|
args,
|
56972
|
-
node.
|
57099
|
+
node.field.type
|
56973
57100
|
)
|
56974
57101
|
);
|
56975
57102
|
return { expression, tempVariables };
|
@@ -57017,26 +57144,34 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
57017
57144
|
);
|
57018
57145
|
}
|
57019
57146
|
lowerSimpleAssignmentToComputedVariable(left, value) {
|
57020
|
-
const setter = left.
|
57147
|
+
const setter = left.field.entity.setter;
|
57021
57148
|
Debug.assertNotNull(setter);
|
57022
57149
|
const args = new OrderedArguments([value], false);
|
57150
|
+
let receiver = left.expression;
|
57151
|
+
if (this._ctx.isPossiblyCastedBaseExpression(receiver)) {
|
57152
|
+
receiver = new ThisExpression(this._ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
57153
|
+
}
|
57023
57154
|
const callExpression2 = this.createCallOfMethodWithExplicitReceiver(
|
57024
57155
|
setter,
|
57025
|
-
|
57156
|
+
receiver,
|
57026
57157
|
args,
|
57027
57158
|
this._ctx.ectx.standardTypes.none
|
57028
57159
|
);
|
57029
57160
|
return new ExpressionStatement3(callExpression2, left.sourceLocation);
|
57030
57161
|
}
|
57031
57162
|
lowerCompoundAssignmentToComputedVariable(left, operatorKind, value, operator) {
|
57032
|
-
const setter = left.
|
57163
|
+
const setter = left.field.entity.setter;
|
57033
57164
|
Debug.assertNotNull(setter);
|
57034
57165
|
const tempVariables = new Array();
|
57035
|
-
|
57036
|
-
|
57166
|
+
let receiver = left.expression;
|
57167
|
+
if (this._ctx.isPossiblyCastedBaseExpression(receiver)) {
|
57168
|
+
receiver = new ThisExpression(this._ctx.ectx.type.ofExpression(receiver), receiver.sourceLocation);
|
57169
|
+
}
|
57170
|
+
const [, receiverTempAssignment, receiverTempAccess] = this.createCachingTemporaryVariable(
|
57171
|
+
receiver,
|
57037
57172
|
tempVariables
|
57038
57173
|
);
|
57039
|
-
const variableGetAccess = FieldAccessExpression.get(receiverTempAccess, false, left.
|
57174
|
+
const variableGetAccess = FieldAccessExpression.get(receiverTempAccess, false, left.field, void 0);
|
57040
57175
|
const binaryOperator = this._ctx.getBinaryExpressionOperatorFromAssignmentOperator(operatorKind);
|
57041
57176
|
const newValue = new BinaryExpression3(
|
57042
57177
|
variableGetAccess,
|
@@ -57049,7 +57184,7 @@ var AliasTypeAndExtensionMembersAccessLowering = class extends ExecutableCodeLow
|
|
57049
57184
|
const args = new OrderedArguments([newValue], false);
|
57050
57185
|
const callExpression2 = this.createCallOfMethodWithExplicitReceiver(
|
57051
57186
|
setter,
|
57052
|
-
receiverTempAssignment,
|
57187
|
+
receiverTempAssignment ?? receiverTempAccess,
|
57053
57188
|
args,
|
57054
57189
|
this._ctx.ectx.standardTypes.none
|
57055
57190
|
);
|
@@ -57656,17 +57791,17 @@ var IndexedAccessExpressionLowering = class extends ExecutableCodeLowering {
|
|
57656
57791
|
Debug.assert(node.left.kind === 30 /* IndexedAccessExpression */);
|
57657
57792
|
Debug.assert(node.left.access.kind === 2 /* GetSet */);
|
57658
57793
|
const tempVariables = [];
|
57659
|
-
const [, receiverTempAssignment, receiverTempAccess] = this.
|
57794
|
+
const [, receiverTempAssignment, receiverTempAccess] = this.createCachingTemporaryVariable(
|
57660
57795
|
node.left.expression,
|
57661
57796
|
tempVariables
|
57662
57797
|
);
|
57663
57798
|
const args = this._ctx.getOrderedArguments(node.left.args);
|
57664
57799
|
const [argumentTempAssignments, argumentTempAccesses] = Query.from(args.values).map((a) => {
|
57665
|
-
const [, argumentTempAssignment, argumentTempAccess] = this.
|
57800
|
+
const [, argumentTempAssignment, argumentTempAccess] = this.createCachingTemporaryVariable(
|
57666
57801
|
a,
|
57667
57802
|
tempVariables
|
57668
57803
|
);
|
57669
|
-
return [argumentTempAssignment, argumentTempAccess];
|
57804
|
+
return [argumentTempAssignment ?? argumentTempAccess, argumentTempAccess];
|
57670
57805
|
}).unzip();
|
57671
57806
|
const access = { kind: 0 /* Get */, getAccessor: node.left.access.getAccessor };
|
57672
57807
|
const indexerGetAccess = new IndexedAccessExpression3(
|
@@ -57686,7 +57821,7 @@ var IndexedAccessExpressionLowering = class extends ExecutableCodeLowering {
|
|
57686
57821
|
void 0
|
57687
57822
|
);
|
57688
57823
|
const methodAccess = new MethodAccessExpression(
|
57689
|
-
receiverTempAssignment,
|
57824
|
+
receiverTempAssignment ?? receiverTempAccess,
|
57690
57825
|
false,
|
57691
57826
|
node.left.access.setAccessor,
|
57692
57827
|
true,
|
@@ -57787,7 +57922,7 @@ var DereferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
57787
57922
|
Debug.assert(node.left.kind === 88 /* DereferenceExpression */);
|
57788
57923
|
Debug.assert(node.left.access.kind === 2 /* GetSet */);
|
57789
57924
|
const tempVariables = [];
|
57790
|
-
const [, receiverTempAssignment, receiverTempAccess] = this.
|
57925
|
+
const [, receiverTempAssignment, receiverTempAccess] = this.createCachingTemporaryVariable(
|
57791
57926
|
node.left.expression,
|
57792
57927
|
tempVariables
|
57793
57928
|
);
|
@@ -57808,7 +57943,7 @@ var DereferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
57808
57943
|
void 0
|
57809
57944
|
);
|
57810
57945
|
const methodAccess = new MethodAccessExpression(
|
57811
|
-
receiverTempAssignment,
|
57946
|
+
receiverTempAssignment ?? receiverTempAccess,
|
57812
57947
|
false,
|
57813
57948
|
node.left.access.setAccessor,
|
57814
57949
|
true,
|
@@ -57862,7 +57997,16 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
57862
57997
|
// recTmp = rec, recTmp === undefined ? undefined : (opTmp = (...args) => { return recTmp.op(...args) }, opTmp._ctx = recTmp, opTmp)
|
57863
57998
|
lowerInstanceMethodAccess(node) {
|
57864
57999
|
const tempVariables = new Array();
|
57865
|
-
const
|
58000
|
+
const receiverIfBaseExpression = this._ctx.ifPossiblyCastedBaseExpressionThenExpression(node.expression);
|
58001
|
+
let receiverTempAssignment = void 0;
|
58002
|
+
let receiverTempGetAccess;
|
58003
|
+
if (receiverIfBaseExpression === void 0) {
|
58004
|
+
const parts = this.createCachingTemporaryVariable(node.expression, tempVariables);
|
58005
|
+
receiverTempAssignment = parts[1];
|
58006
|
+
receiverTempGetAccess = parts[2];
|
58007
|
+
} else {
|
58008
|
+
receiverTempGetAccess = receiverIfBaseExpression;
|
58009
|
+
}
|
57866
58010
|
const methodAccess = new MethodAccessExpression(
|
57867
58011
|
receiverTempGetAccess,
|
57868
58012
|
false,
|
@@ -57889,7 +58033,7 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
57889
58033
|
node.method.returnType,
|
57890
58034
|
void 0
|
57891
58035
|
);
|
57892
|
-
const [, boundMethodTempAssignment, boundMethodTempGetAccess] = this.
|
58036
|
+
const [, boundMethodTempAssignment, boundMethodTempGetAccess] = this.createCachingTemporaryVariable(functionLiteral, tempVariables);
|
57893
58037
|
let contextFieldAssignment;
|
57894
58038
|
if (!node.method.entity.details.isStatic) {
|
57895
58039
|
const contextFieldSetAccess = new JsPropertyAccessExpression(
|
@@ -57899,10 +58043,16 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
57899
58043
|
this._ctx.ectx.standardTypes.refObject,
|
57900
58044
|
void 0
|
57901
58045
|
);
|
58046
|
+
let context;
|
58047
|
+
if (receiverIfBaseExpression === void 0) {
|
58048
|
+
context = receiverTempGetAccess;
|
58049
|
+
} else {
|
58050
|
+
context = new ThisExpression(this._ctx.ectx.type.ofExpression(receiverIfBaseExpression), void 0);
|
58051
|
+
}
|
57902
58052
|
contextFieldAssignment = new AssignmentExpression(
|
57903
58053
|
contextFieldSetAccess,
|
57904
58054
|
0 /* Equals */,
|
57905
|
-
|
58055
|
+
context,
|
57906
58056
|
void 0,
|
57907
58057
|
void 0
|
57908
58058
|
);
|
@@ -57918,7 +58068,10 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
57918
58068
|
void 0
|
57919
58069
|
);
|
57920
58070
|
const firstExpression = new NoneLiteral(void 0);
|
57921
|
-
const expressions =
|
58071
|
+
const expressions = new Array();
|
58072
|
+
if (boundMethodTempAssignment !== void 0) {
|
58073
|
+
expressions.push(boundMethodTempAssignment);
|
58074
|
+
}
|
57922
58075
|
if (contextFieldAssignment !== void 0) {
|
57923
58076
|
expressions.push(contextFieldAssignment);
|
57924
58077
|
}
|
@@ -57931,14 +58084,25 @@ var FunctionObjectLowering = class _FunctionObjectLowering extends ExecutableCod
|
|
57931
58084
|
this._ctx.ectx.type.ofExpression(node),
|
57932
58085
|
void 0
|
57933
58086
|
);
|
57934
|
-
|
58087
|
+
const resultExpressions = new Array();
|
58088
|
+
if (receiverTempAssignment !== void 0) {
|
58089
|
+
resultExpressions.push(receiverTempAssignment);
|
58090
|
+
}
|
58091
|
+
resultExpressions.push(ternaryExpression);
|
58092
|
+
resultExpression = new CommaExpression(resultExpressions, node.sourceLocation);
|
57935
58093
|
} else {
|
57936
|
-
const
|
58094
|
+
const resultExpressions = new Array();
|
58095
|
+
if (receiverTempAssignment !== void 0) {
|
58096
|
+
resultExpressions.push(receiverTempAssignment);
|
58097
|
+
}
|
58098
|
+
if (boundMethodTempAssignment !== void 0) {
|
58099
|
+
resultExpressions.push(boundMethodTempAssignment);
|
58100
|
+
}
|
57937
58101
|
if (contextFieldAssignment !== void 0) {
|
57938
|
-
|
58102
|
+
resultExpressions.push(contextFieldAssignment);
|
57939
58103
|
}
|
57940
|
-
|
57941
|
-
resultExpression = new CommaExpression(
|
58104
|
+
resultExpressions.push(boundMethodTempGetAccess);
|
58105
|
+
resultExpression = new CommaExpression(resultExpressions, node.sourceLocation);
|
57942
58106
|
}
|
57943
58107
|
return { expression: resultExpression, tempVariables };
|
57944
58108
|
}
|
@@ -58129,13 +58293,13 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
58129
58293
|
return result;
|
58130
58294
|
}
|
58131
58295
|
const nameKeySymbolDeclaration = this.ifTypeMemberHasComputedNameThenSymbolDeclaration(
|
58132
|
-
node.
|
58296
|
+
node.field.entity,
|
58133
58297
|
false
|
58134
58298
|
);
|
58135
58299
|
if (nameKeySymbolDeclaration !== void 0 && !node.options.forceUseNonComputedName) {
|
58136
58300
|
node.ifComputedThenKey = this._ctx.createKeyForComputedNameWithSymbolKey(nameKeySymbolDeclaration);
|
58137
58301
|
}
|
58138
|
-
if (node.
|
58302
|
+
if (node.field.entity.ifTypeMemberThenContainingType !== void 0 && this._ctx.ectx.isAspectTypeEntity(node.field.entity.ifTypeMemberThenContainingType) && node.field.entity.details.isStatic) {
|
58139
58303
|
this.lowerStaticAliasFieldAccess(node);
|
58140
58304
|
}
|
58141
58305
|
return preserveExpression();
|
@@ -58336,7 +58500,7 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
|
|
58336
58500
|
// Статические члены аспектов не добавляются в тип, который реализует аспект. Поэтому если доступ к статическому полю
|
58337
58501
|
// или методу осуществляется через производный тип, его необходимо заменить на доступ через тип-аспект.
|
58338
58502
|
lowerStaticAliasFieldAccess(node) {
|
58339
|
-
const containingType = node.
|
58503
|
+
const containingType = node.field.entity.ifTypeMemberThenContainingType;
|
58340
58504
|
Debug.assertNotNull(containingType);
|
58341
58505
|
if (!(node.expression.kind === 64 /* TypeAccessExpression */ && node.expression.entity === containingType)) {
|
58342
58506
|
node.expression = new TypeAccessExpression(containingType, void 0);
|
@@ -58443,29 +58607,29 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
58443
58607
|
leftExpressionGetAccess = VariableAccessExpression.get(left.variable);
|
58444
58608
|
break;
|
58445
58609
|
case 69 /* FieldAccessExpression */: {
|
58446
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58610
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(
|
58447
58611
|
left.expression,
|
58448
58612
|
tempVariables
|
58449
58613
|
);
|
58450
58614
|
leftExpressionSetAccess = FieldAccessExpression.set(
|
58451
|
-
receiverTempAssignment,
|
58615
|
+
receiverTempAssignment ?? receiverTempGetAccess,
|
58452
58616
|
false,
|
58453
|
-
left.
|
58617
|
+
left.field
|
58454
58618
|
);
|
58455
58619
|
leftExpressionGetAccess = FieldAccessExpression.get(
|
58456
58620
|
receiverTempGetAccess,
|
58457
58621
|
false,
|
58458
|
-
left.
|
58622
|
+
left.field
|
58459
58623
|
);
|
58460
58624
|
break;
|
58461
58625
|
}
|
58462
58626
|
case 83 /* JsPropertyAccessExpression */: {
|
58463
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58627
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(
|
58464
58628
|
left.expression,
|
58465
58629
|
tempVariables
|
58466
58630
|
);
|
58467
58631
|
leftExpressionSetAccess = new JsPropertyAccessExpression(
|
58468
|
-
receiverTempAssignment,
|
58632
|
+
receiverTempAssignment ?? receiverTempGetAccess,
|
58469
58633
|
false,
|
58470
58634
|
left.name,
|
58471
58635
|
left.type,
|
@@ -58481,12 +58645,12 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
58481
58645
|
break;
|
58482
58646
|
}
|
58483
58647
|
case 77 /* JsIndexedAccessExpression */: {
|
58484
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58485
|
-
const [, argumentTempAssignment, argumentTempGetAccess] = this.
|
58648
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(left.expression, tempVariables);
|
58649
|
+
const [, argumentTempAssignment, argumentTempGetAccess] = this.createCachingTemporaryVariable(left.expression, tempVariables);
|
58486
58650
|
leftExpressionSetAccess = new JsIndexedAccessExpression(
|
58487
|
-
receiverTempAssignment,
|
58651
|
+
receiverTempAssignment ?? receiverTempGetAccess,
|
58488
58652
|
false,
|
58489
|
-
argumentTempAssignment,
|
58653
|
+
argumentTempAssignment ?? argumentTempGetAccess,
|
58490
58654
|
left.type,
|
58491
58655
|
void 0
|
58492
58656
|
);
|
@@ -58506,17 +58670,17 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
58506
58670
|
}
|
58507
58671
|
case 30 /* IndexedAccessExpression */: {
|
58508
58672
|
Debug.assert(left.access.kind === 2 /* GetSet */);
|
58509
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58673
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(
|
58510
58674
|
left.expression,
|
58511
58675
|
tempVariables
|
58512
58676
|
);
|
58513
58677
|
const args = this._ctx.getOrderedArguments(left.args);
|
58514
58678
|
const [argumentTempAssignments, argumentTempAccesses] = Query.from(args.values).map((a) => {
|
58515
|
-
const [, argumentTempAssignment, argumentTempAccess] = this.
|
58679
|
+
const [, argumentTempAssignment, argumentTempAccess] = this.createCachingTemporaryVariable(
|
58516
58680
|
a,
|
58517
58681
|
tempVariables
|
58518
58682
|
);
|
58519
|
-
return [argumentTempAssignment, argumentTempAccess];
|
58683
|
+
return [argumentTempAssignment ?? argumentTempAccess, argumentTempAccess];
|
58520
58684
|
}).unzip();
|
58521
58685
|
const getAccess = { kind: 0 /* Get */, getAccessor: left.access.getAccessor };
|
58522
58686
|
leftExpressionGetAccess = new IndexedAccessExpression3(
|
@@ -58528,7 +58692,7 @@ var OperatorsUsageLowering = class extends ExecutableCodeLowering {
|
|
58528
58692
|
);
|
58529
58693
|
const setAccess = { kind: 1 /* Set */, setAccessor: left.access.setAccessor };
|
58530
58694
|
leftExpressionSetAccess = new IndexedAccessExpression3(
|
58531
|
-
receiverTempAssignment,
|
58695
|
+
receiverTempAssignment ?? receiverTempGetAccess,
|
58532
58696
|
false,
|
58533
58697
|
new OrderedArguments(argumentTempAssignments, args.isLastArgumentSpreading),
|
58534
58698
|
setAccess,
|
@@ -58559,8 +58723,8 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58559
58723
|
this._proxyVariableByOriginal = proxyVariableByOriginal;
|
58560
58724
|
}
|
58561
58725
|
tryLowerFieldAccessExpression(node) {
|
58562
|
-
if (node.
|
58563
|
-
const proxyVariable = this.findProxyVariable(node.
|
58726
|
+
if (node.field.entity.details.isProxiedField !== void 0) {
|
58727
|
+
const proxyVariable = this.findProxyVariable(node.field.entity);
|
58564
58728
|
if (proxyVariable !== void 0) {
|
58565
58729
|
const { expression, tempVariables } = this.lowerProxiedFieldRead(node, proxyVariable);
|
58566
58730
|
return replaceExpression(expression, tempVariables);
|
@@ -58569,8 +58733,8 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58569
58733
|
return void 0;
|
58570
58734
|
}
|
58571
58735
|
tryLowerAssignmentStatement(node) {
|
58572
|
-
if (node.left.kind === 69 /* FieldAccessExpression */ && node.left.
|
58573
|
-
const proxyVariable = this.findProxyVariable(node.left.
|
58736
|
+
if (node.left.kind === 69 /* FieldAccessExpression */ && node.left.field.entity.details.isProxiedField !== void 0) {
|
58737
|
+
const proxyVariable = this.findProxyVariable(node.left.field.entity);
|
58574
58738
|
if (proxyVariable !== void 0) {
|
58575
58739
|
const { statement, tempVariables } = this.lowerProxiedFieldAssignment(node, proxyVariable);
|
58576
58740
|
return replaceStatement(statement, tempVariables);
|
@@ -58592,9 +58756,9 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58592
58756
|
// обВрем = об, обВрем.прокси_поле.записать(значение, обВрем, "поле", new ПутьКСинтаксическомуУзлу("..."))
|
58593
58757
|
lowerProxiedFieldAssignment(node, proxyVariable) {
|
58594
58758
|
Debug.assert(node.left.kind === 69 /* FieldAccessExpression */);
|
58595
|
-
const proxiedVariableEntity = node.left.
|
58759
|
+
const proxiedVariableEntity = node.left.field.entity;
|
58596
58760
|
const tempVariables = new Array();
|
58597
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58761
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(node.left.expression, tempVariables);
|
58598
58762
|
Debug.assert(node.left.isOptionalAccess === false, "\u0414\u043E\u0441\u0442\u0443\u043F \u043A \u043F\u043E\u043B\u044E \u0447\u0435\u0440\u0435\u0437 ?. \u0432 \u043B\u0435\u0432\u043E\u0439 \u0447\u0430\u0441\u0442\u0438 \u043F\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F.");
|
58599
58763
|
const writeMethodAccess = new MethodAccessExpression(
|
58600
58764
|
FieldAccessExpression.get(
|
@@ -58623,7 +58787,12 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58623
58787
|
this._ctx.ectx.type.ofExpression(node.right),
|
58624
58788
|
void 0
|
58625
58789
|
);
|
58626
|
-
const
|
58790
|
+
const expressions = new Array();
|
58791
|
+
if (receiverTempAssignment !== void 0) {
|
58792
|
+
expressions.push(receiverTempAssignment);
|
58793
|
+
}
|
58794
|
+
expressions.push(writeMethodCall);
|
58795
|
+
const commaExpression = new CommaExpression(expressions, void 0);
|
58627
58796
|
const statement = new ExpressionStatement3(commaExpression, void 0);
|
58628
58797
|
return { statement, tempVariables };
|
58629
58798
|
}
|
@@ -58633,8 +58802,8 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58633
58802
|
// обВрем = об, обВрем.прокси_поле.прочитать(обВрем, "поле", new ПутьКСинтаксическомуУзлу("..."))
|
58634
58803
|
lowerProxiedFieldRead(node, proxyVariable) {
|
58635
58804
|
const tempVariables = new Array();
|
58636
|
-
const [, receiverTempAssignment, receiverTempGetAccess] = this.
|
58637
|
-
const proxiedVariableEntity = node.
|
58805
|
+
const [, receiverTempAssignment, receiverTempGetAccess] = this.createCachingTemporaryVariable(node.expression, tempVariables);
|
58806
|
+
const proxiedVariableEntity = node.field.entity;
|
58638
58807
|
const readMethodAccess = new MethodAccessExpression(
|
58639
58808
|
FieldAccessExpression.get(
|
58640
58809
|
receiverTempGetAccess,
|
@@ -58661,7 +58830,12 @@ var ProxiedVariableAccessLowering = class extends ExecutableCodeLowering {
|
|
58661
58830
|
this._ctx.ectx.type.ofExpression(node),
|
58662
58831
|
void 0
|
58663
58832
|
);
|
58664
|
-
const
|
58833
|
+
const expressions = new Array();
|
58834
|
+
if (receiverTempAssignment !== void 0) {
|
58835
|
+
expressions.push(receiverTempAssignment);
|
58836
|
+
}
|
58837
|
+
expressions.push(readMethodCall);
|
58838
|
+
const expression = new CommaExpression(expressions, void 0);
|
58665
58839
|
return { expression, tempVariables };
|
58666
58840
|
}
|
58667
58841
|
createAccessLocation(node) {
|
@@ -58709,13 +58883,13 @@ var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
58709
58883
|
const access = referencedExpression.access;
|
58710
58884
|
Debug.assert(isGetOrGetSet(access));
|
58711
58885
|
const tempVariables = new Array();
|
58712
|
-
const [, receiverAssignment, receiverGetAccess] = this.
|
58713
|
-
const temporaryVariableAssignments = [receiverAssignment];
|
58886
|
+
const [, receiverAssignment, receiverGetAccess] = this.createCachingTemporaryVariable(referencedExpression.expression, tempVariables);
|
58887
|
+
const temporaryVariableAssignments = [receiverAssignment ?? receiverGetAccess];
|
58714
58888
|
const args = this._ctx.getOrderedArguments(referencedExpression.args);
|
58715
58889
|
const argumentGetAccesses = [];
|
58716
58890
|
for (const argument of args.values) {
|
58717
|
-
const [, argumentAssignment, argumentGetAccess] = this.
|
58718
|
-
temporaryVariableAssignments.push(argumentAssignment);
|
58891
|
+
const [, argumentAssignment, argumentGetAccess] = this.createCachingTemporaryVariable(argument, tempVariables);
|
58892
|
+
temporaryVariableAssignments.push(argumentAssignment ?? argumentGetAccess);
|
58719
58893
|
argumentGetAccesses.push(argumentGetAccess);
|
58720
58894
|
}
|
58721
58895
|
const getAccess = { kind: 0 /* Get */, getAccessor: access.getAccessor };
|
@@ -58755,11 +58929,11 @@ var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
58755
58929
|
}
|
58756
58930
|
lowerFieldAccessExpressionReference(referencedExpression, sourceLocation) {
|
58757
58931
|
const tempVariables = new Array();
|
58758
|
-
const [, receiverAssignment, receiverGetAccess] = this.
|
58932
|
+
const [, receiverAssignment, receiverGetAccess] = this.createCachingTemporaryVariable(referencedExpression.expression, tempVariables);
|
58759
58933
|
const variableGetAccess = FieldAccessExpression.get(
|
58760
58934
|
receiverGetAccess,
|
58761
58935
|
referencedExpression.isOptionalAccess,
|
58762
|
-
referencedExpression.
|
58936
|
+
referencedExpression.field
|
58763
58937
|
);
|
58764
58938
|
const reader = this.createReaderMethod(variableGetAccess);
|
58765
58939
|
let writer;
|
@@ -58767,12 +58941,17 @@ var ReferenceExpressionLowering = class extends ExecutableCodeLowering {
|
|
58767
58941
|
const variableSetAccess = FieldAccessExpression.set(
|
58768
58942
|
receiverGetAccess,
|
58769
58943
|
referencedExpression.isOptionalAccess,
|
58770
|
-
referencedExpression.
|
58944
|
+
referencedExpression.field
|
58771
58945
|
);
|
58772
58946
|
writer = this.createWriterMethod(variableSetAccess);
|
58773
58947
|
}
|
58774
58948
|
const reference = this.createReference(reader, writer, sourceLocation);
|
58775
|
-
const
|
58949
|
+
const expressions = new Array();
|
58950
|
+
if (receiverAssignment !== void 0) {
|
58951
|
+
expressions.push(receiverAssignment);
|
58952
|
+
}
|
58953
|
+
expressions.push(reference);
|
58954
|
+
const commaExpression = new CommaExpression(expressions, void 0);
|
58776
58955
|
return { expression: commaExpression, tempVariables };
|
58777
58956
|
}
|
58778
58957
|
createReaderMethod(getExpression) {
|
@@ -58948,7 +59127,8 @@ var IsExpressionLowering = class extends ExecutableCodeLowering {
|
|
58948
59127
|
lower(expression) {
|
58949
59128
|
let type = expression.type;
|
58950
59129
|
if (type.equals(this._ctx.ectx.standardTypes.integer)) {
|
58951
|
-
const
|
59130
|
+
const tempVariables = new Array();
|
59131
|
+
const [, expressionTempAssignment, expressionTempAccess] = this.createCachingTemporaryVariable(expression.expression, tempVariables);
|
58952
59132
|
const typeOfCheck = this.createTypeOfCheck(expressionTempAccess, "number", expression.sourceLocation);
|
58953
59133
|
const numberIsIntegerCheck = this._ctx.helperFunctions.createNumberIsIntegerFunctionCall(expressionTempAccess);
|
58954
59134
|
const combinedCheck = new BinaryExpression3(
|
@@ -58959,8 +59139,13 @@ var IsExpressionLowering = class extends ExecutableCodeLowering {
|
|
58959
59139
|
void 0,
|
58960
59140
|
void 0
|
58961
59141
|
);
|
58962
|
-
const
|
58963
|
-
|
59142
|
+
const expressions = new Array();
|
59143
|
+
if (expressionTempAssignment !== void 0) {
|
59144
|
+
expressions.push(expressionTempAssignment);
|
59145
|
+
}
|
59146
|
+
expressions.push(combinedCheck);
|
59147
|
+
const commaExpression = new CommaExpression(expressions, void 0);
|
59148
|
+
return { expression: commaExpression, tempVariables };
|
58964
59149
|
}
|
58965
59150
|
if (type.equals(this._ctx.ectx.standardTypes.number)) {
|
58966
59151
|
return { expression: this.createTypeOfCheck(expression.expression, "number", expression.sourceLocation) };
|
@@ -59050,7 +59235,7 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
59050
59235
|
return void 0;
|
59051
59236
|
}
|
59052
59237
|
tryLowerFieldAccessExpression(node) {
|
59053
|
-
const entity = node.
|
59238
|
+
const entity = node.field.entity;
|
59054
59239
|
if (this.isReceiverBaseExpression(node.expression) && this.isSourceAspectType(entity.ifTypeMemberThenContainingType)) {
|
59055
59240
|
Debug.assert(node.accessKind === 0 /* Get */);
|
59056
59241
|
return replaceExpression(this.lowerBaseAspectFieldGetAccess(node));
|
@@ -59062,7 +59247,7 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
59062
59247
|
if (left.kind !== 69 /* FieldAccessExpression */) {
|
59063
59248
|
return void 0;
|
59064
59249
|
}
|
59065
|
-
const entity = left.
|
59250
|
+
const entity = left.field.entity;
|
59066
59251
|
if (this.isReceiverBaseExpression(left.expression) && this.isSourceAspectType(entity.ifTypeMemberThenContainingType)) {
|
59067
59252
|
return replaceStatement(this.lowerBaseAspectFieldAssignment(node, left));
|
59068
59253
|
}
|
@@ -59107,12 +59292,12 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
59107
59292
|
* JS: Object.getOwnPropertyDescriptor(Aspect.prototype, 'f1').get.call(this)
|
59108
59293
|
*/
|
59109
59294
|
lowerBaseAspectFieldGetAccess(node) {
|
59110
|
-
const containingType = node.
|
59295
|
+
const containingType = node.field.entity.ifTypeMemberThenContainingType;
|
59111
59296
|
Debug.assertNotNull(containingType);
|
59112
59297
|
const aspectPrototypeAccess = this._ctx.createPrototypeAccess(new TypeAccessExpression(containingType, void 0));
|
59113
59298
|
const getOwnPropertyDescriptorCall = this._ctx.createGetOwnPropertyDescriptorCall(
|
59114
59299
|
aspectPrototypeAccess,
|
59115
|
-
new TextWithEntityName(node.
|
59300
|
+
new TextWithEntityName(node.field.entity, void 0)
|
59116
59301
|
);
|
59117
59302
|
const descriptorGetAccess = new JsPropertyAccessExpression(
|
59118
59303
|
getOwnPropertyDescriptorCall,
|
@@ -59126,19 +59311,19 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
59126
59311
|
[new ThisExpression(this._ctx.ectx.type.ofExpression(node.expression), void 0)],
|
59127
59312
|
false
|
59128
59313
|
);
|
59129
|
-
return new CallExpression5(callMethodAccess, false, callArguments, false, node.
|
59314
|
+
return new CallExpression5(callMethodAccess, false, callArguments, false, node.field.type, node.sourceLocation);
|
59130
59315
|
}
|
59131
59316
|
/**
|
59132
59317
|
* Artel: base.f1 = value
|
59133
59318
|
* JS: Object.getOwnPropertyDescriptor(Aspect.prototype, 'f1').set.call(this, value)
|
59134
59319
|
*/
|
59135
59320
|
lowerBaseAspectFieldAssignment(node, left) {
|
59136
|
-
const containingType = left.
|
59321
|
+
const containingType = left.field.entity.ifTypeMemberThenContainingType;
|
59137
59322
|
Debug.assertNotNull(containingType);
|
59138
59323
|
const aspectPrototypeAccess = this._ctx.createPrototypeAccess(new TypeAccessExpression(containingType, void 0));
|
59139
59324
|
const getOwnPropertyDescriptorCall = this._ctx.createGetOwnPropertyDescriptorCall(
|
59140
59325
|
aspectPrototypeAccess,
|
59141
|
-
new TextWithEntityName(left.
|
59326
|
+
new TextWithEntityName(left.field.entity, void 0)
|
59142
59327
|
);
|
59143
59328
|
const descriptorGetAccess = new JsPropertyAccessExpression(
|
59144
59329
|
getOwnPropertyDescriptorCall,
|
@@ -59157,16 +59342,13 @@ var BaseAspectMemberAccessLowering = class extends ExecutableCodeLowering {
|
|
59157
59342
|
false,
|
59158
59343
|
callArguments,
|
59159
59344
|
false,
|
59160
|
-
left.
|
59345
|
+
left.field.type,
|
59161
59346
|
node.sourceLocation
|
59162
59347
|
);
|
59163
59348
|
return new ExpressionStatement3(expression, node.sourceLocation);
|
59164
59349
|
}
|
59165
59350
|
isReceiverBaseExpression(node) {
|
59166
|
-
|
59167
|
-
node = node.expression;
|
59168
|
-
}
|
59169
|
-
return node.kind === 89 /* BaseExpression */;
|
59351
|
+
return this._ctx.isPossiblyCastedBaseExpression(node);
|
59170
59352
|
}
|
59171
59353
|
isSourceAspectType(entity) {
|
59172
59354
|
return entity?.typeOrExtensionKind === 0 /* StructuredType */ && entity.details.structuredTypeKind === 2 /* Aspect */ && entity.containingPackage.details.isSource;
|
@@ -62117,7 +62299,7 @@ var _IrToJs = class _IrToJs {
|
|
62117
62299
|
property = this.convertExpression(expression.ifComputedThenKey);
|
62118
62300
|
computed = true;
|
62119
62301
|
} else {
|
62120
|
-
const name = this.getEntityName(expression.
|
62302
|
+
const name = this.getEntityName(expression.field.entity);
|
62121
62303
|
computed = !js.isValidIdentifier(name);
|
62122
62304
|
property = computed ? js.stringLiteral(name) : js.identifier(name);
|
62123
62305
|
}
|