@artel/artc 0.9.26001 → 0.9.26002
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 +44 -58
- package/build/{chunk-XMOVE7NP.js → chunk-6SZZ3VZ6.js} +2 -2
- package/build/{chunk-FLMCFMMG.js → chunk-LGYFTSDE.js} +460 -511
- package/build/{chunk-V2TFXOVJ.js → chunk-QHIZWFJU.js} +1 -1
- package/build/types/emitter/IrBuilderM.d.ts +1 -1
- package/build/types/entities/interfaces/StructuredTypeEntity.d.ts +1 -1
- package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +5 -5
- package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +6 -6
- package/build/types/entities/translated/TranslatedStructuredTypeEntity.d.ts +4 -4
- package/build/types/services/m/NodeSemanticInfo.d.ts +1 -1
- package/build/types/ts-interop/TypeEntities.d.ts +5 -5
- package/build/types/types/AliasType.d.ts +2 -4
- package/build/types/types/FunctionType.d.ts +2 -4
- package/build/types/types/IntersectionType.d.ts +2 -2
- package/build/types/types/ParameterType.d.ts +2 -3
- package/build/types/types/ReducedType.d.ts +2 -4
- package/build/types/types/StructuredType.d.ts +3 -5
- package/build/types/types/SubstitutionStubType.d.ts +2 -2
- package/build/types/types/Type.d.ts +2 -2
- package/build/types/types/UnionType.d.ts +2 -2
- package/build/types/types/UnresolvedType.d.ts +2 -2
- package/build/types/types/VariantType.d.ts +2 -4
- package/package.json +1 -1
|
@@ -780,7 +780,7 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
|
780
780
|
};
|
|
781
781
|
|
|
782
782
|
// source/common/Constants.ts
|
|
783
|
-
var ArtelVersion = true ? "0.9.
|
|
783
|
+
var ArtelVersion = true ? "0.9.26002" : "";
|
|
784
784
|
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel", ".\u0430\u0440\u0442\u043C", ".\u0430\u0440\u0442\u0435\u043B\u044C\u043C", ".artm", ".artelm"];
|
|
785
785
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
|
786
786
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
|
@@ -4579,7 +4579,7 @@ var TypeEntity;
|
|
|
4579
4579
|
function isAbstract(entity) {
|
|
4580
4580
|
switch (entity.typeEntityKind) {
|
|
4581
4581
|
case 1 /* Structured */:
|
|
4582
|
-
return entity.isAbstract() || entity.
|
|
4582
|
+
return entity.isAbstract() || entity.structuredTypeKind === 2 /* Aspect */;
|
|
4583
4583
|
case 0 /* Function */:
|
|
4584
4584
|
case 2 /* Parameter */:
|
|
4585
4585
|
case 3 /* Variant */:
|
|
@@ -4594,9 +4594,9 @@ var TypeEntity;
|
|
|
4594
4594
|
function isAbstractOrAliasedAbstract(entity) {
|
|
4595
4595
|
switch (entity.typeEntityKind) {
|
|
4596
4596
|
case 1 /* Structured */:
|
|
4597
|
-
return entity.isAbstract() || entity.
|
|
4597
|
+
return entity.isAbstract() || entity.structuredTypeKind === 2 /* Aspect */;
|
|
4598
4598
|
case 4 /* Alias */: {
|
|
4599
|
-
const aliasedTypeEntity = entity.getAliasedType().cycleFree.
|
|
4599
|
+
const aliasedTypeEntity = entity.getAliasedType().cycleFree.entity;
|
|
4600
4600
|
return aliasedTypeEntity !== void 0 ? isAbstractOrAliasedAbstract(aliasedTypeEntity) : false;
|
|
4601
4601
|
}
|
|
4602
4602
|
case 0 /* Function */:
|
|
@@ -4612,7 +4612,7 @@ var TypeEntity;
|
|
|
4612
4612
|
function isBasic(entity) {
|
|
4613
4613
|
switch (entity.typeEntityKind) {
|
|
4614
4614
|
case 1 /* Structured */:
|
|
4615
|
-
return entity.markedBasic() || entity.
|
|
4615
|
+
return entity.markedBasic() || entity.structuredTypeKind === 2 /* Aspect */;
|
|
4616
4616
|
case 0 /* Function */:
|
|
4617
4617
|
case 2 /* Parameter */:
|
|
4618
4618
|
case 3 /* Variant */:
|
|
@@ -4627,9 +4627,9 @@ var TypeEntity;
|
|
|
4627
4627
|
function isBasicOrAliasedBasic(entity) {
|
|
4628
4628
|
switch (entity.typeEntityKind) {
|
|
4629
4629
|
case 1 /* Structured */:
|
|
4630
|
-
return entity.markedBasic() || entity.
|
|
4630
|
+
return entity.markedBasic() || entity.structuredTypeKind === 2 /* Aspect */;
|
|
4631
4631
|
case 4 /* Alias */: {
|
|
4632
|
-
const aliasedTypeEntity = entity.getAliasedType().cycleFree.
|
|
4632
|
+
const aliasedTypeEntity = entity.getAliasedType().cycleFree.entity;
|
|
4633
4633
|
return aliasedTypeEntity !== void 0 ? isBasicOrAliasedBasic(aliasedTypeEntity) : false;
|
|
4634
4634
|
}
|
|
4635
4635
|
case 0 /* Function */:
|
|
@@ -4829,9 +4829,8 @@ function ifTypeEntityIsFunctionTypeAliasThenFunctionType(entity) {
|
|
|
4829
4829
|
if (entity.typeEntityKind === 4 /* Alias */) {
|
|
4830
4830
|
const aliasedType = entity.getAliasedType().cycleFree;
|
|
4831
4831
|
if (aliasedType.kind === "function") {
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
result = aliasedTypeEntity;
|
|
4832
|
+
if (aliasedType.entity.subkind === "anonymous") {
|
|
4833
|
+
result = aliasedType.entity;
|
|
4835
4834
|
}
|
|
4836
4835
|
}
|
|
4837
4836
|
}
|
|
@@ -29281,7 +29280,7 @@ var TypeDeclarationStructured_entity = class {
|
|
|
29281
29280
|
return this.entity.getTypeParameters().map((p) => new TypeParameterValue_typeParameter(p));
|
|
29282
29281
|
}
|
|
29283
29282
|
getStructuredTypeKind() {
|
|
29284
|
-
return this.entity.
|
|
29283
|
+
return this.entity.structuredTypeKind;
|
|
29285
29284
|
}
|
|
29286
29285
|
getContainer() {
|
|
29287
29286
|
return createTypeEntityContainer(this.entity);
|
|
@@ -29491,7 +29490,7 @@ var StructuredTypeUsage_type = class {
|
|
|
29491
29490
|
this.kind = "structured";
|
|
29492
29491
|
}
|
|
29493
29492
|
ifNamedThenEntity() {
|
|
29494
|
-
const entity = this.type.
|
|
29493
|
+
const entity = this.type.entity;
|
|
29495
29494
|
switch (entity.subkind) {
|
|
29496
29495
|
case "package":
|
|
29497
29496
|
case "local":
|
|
@@ -29503,13 +29502,13 @@ var StructuredTypeUsage_type = class {
|
|
|
29503
29502
|
}
|
|
29504
29503
|
}
|
|
29505
29504
|
getStructuredTypeKind() {
|
|
29506
|
-
return this.type.
|
|
29505
|
+
return this.type.structuredTypeKind;
|
|
29507
29506
|
}
|
|
29508
29507
|
getTypeParameterValues() {
|
|
29509
|
-
return Query.from(this.type.
|
|
29508
|
+
return Query.from(this.type.substitutions.getTypes()).map((t) => new TypeParameterValue_typeArgument(t)).toArray();
|
|
29510
29509
|
}
|
|
29511
29510
|
getContainer() {
|
|
29512
|
-
return createTypeEntityContainer(this.type.
|
|
29511
|
+
return createTypeEntityContainer(this.type.entity);
|
|
29513
29512
|
}
|
|
29514
29513
|
};
|
|
29515
29514
|
var StructuredTypeUsage_entity = class {
|
|
@@ -29529,7 +29528,7 @@ var StructuredTypeUsage_entity = class {
|
|
|
29529
29528
|
}
|
|
29530
29529
|
}
|
|
29531
29530
|
getStructuredTypeKind() {
|
|
29532
|
-
return this.entity.
|
|
29531
|
+
return this.entity.structuredTypeKind;
|
|
29533
29532
|
}
|
|
29534
29533
|
getTypeParameterValues() {
|
|
29535
29534
|
return this.entity.getTypeParameters().map((p) => new TypeParameterValue_typeParameter(p));
|
|
@@ -29544,10 +29543,10 @@ var VariantTypeUsage_type = class {
|
|
|
29544
29543
|
this.kind = "variant";
|
|
29545
29544
|
}
|
|
29546
29545
|
ifNamedThenEntity() {
|
|
29547
|
-
return this.type.
|
|
29546
|
+
return this.type.entity;
|
|
29548
29547
|
}
|
|
29549
29548
|
getContainer() {
|
|
29550
|
-
return createTypeEntityContainer(this.type.
|
|
29549
|
+
return createTypeEntityContainer(this.type.entity);
|
|
29551
29550
|
}
|
|
29552
29551
|
};
|
|
29553
29552
|
var VariantTypeUsage_entity = class {
|
|
@@ -29574,7 +29573,7 @@ var FunctionTypeUsage_type = class {
|
|
|
29574
29573
|
return this.type.isAsync();
|
|
29575
29574
|
}
|
|
29576
29575
|
getTypeParameterValues() {
|
|
29577
|
-
return Query.from(this.type.
|
|
29576
|
+
return Query.from(this.type.substitutions.getTypes()).map((t) => new TypeParameterValue_typeArgument(t)).toArray();
|
|
29578
29577
|
}
|
|
29579
29578
|
getParameters() {
|
|
29580
29579
|
return this.type.getParameters().map((p) => new ParameterDeclaration_typeMember(p));
|
|
@@ -29583,7 +29582,7 @@ var FunctionTypeUsage_type = class {
|
|
|
29583
29582
|
return this.type.getReturnType();
|
|
29584
29583
|
}
|
|
29585
29584
|
getContainer() {
|
|
29586
|
-
return createTypeEntityContainer(this.type.
|
|
29585
|
+
return createTypeEntityContainer(this.type.entity);
|
|
29587
29586
|
}
|
|
29588
29587
|
};
|
|
29589
29588
|
var FunctionTypeUsage_entity = class {
|
|
@@ -29616,16 +29615,16 @@ var AliasTypeUsage_type = class {
|
|
|
29616
29615
|
this.kind = "alias";
|
|
29617
29616
|
}
|
|
29618
29617
|
getEntity() {
|
|
29619
|
-
return this.type.
|
|
29618
|
+
return this.type.entity;
|
|
29620
29619
|
}
|
|
29621
29620
|
getTypeParameterValues() {
|
|
29622
|
-
return Query.from(this.type.
|
|
29621
|
+
return Query.from(this.type.substitutions.getTypes()).map((t) => new TypeParameterValue_typeArgument(t)).toArray();
|
|
29623
29622
|
}
|
|
29624
29623
|
getAliasedType() {
|
|
29625
29624
|
return this.type.getAliasedType();
|
|
29626
29625
|
}
|
|
29627
29626
|
getContainer() {
|
|
29628
|
-
return createTypeEntityContainer(this.type.
|
|
29627
|
+
return createTypeEntityContainer(this.type.entity);
|
|
29629
29628
|
}
|
|
29630
29629
|
};
|
|
29631
29630
|
var AliasTypeUsage_entity = class {
|
|
@@ -29652,16 +29651,16 @@ var ReducedTypeUsage_type = class {
|
|
|
29652
29651
|
this.kind = "reduced";
|
|
29653
29652
|
}
|
|
29654
29653
|
getEntity() {
|
|
29655
|
-
return this.type.
|
|
29654
|
+
return this.type.entity;
|
|
29656
29655
|
}
|
|
29657
29656
|
getTypeParameterValues() {
|
|
29658
|
-
return Query.from(this.type.
|
|
29657
|
+
return Query.from(this.type.substitutions.getTypes()).map((t) => new TypeParameterValue_typeArgument(t)).toArray();
|
|
29659
29658
|
}
|
|
29660
29659
|
getReductionSource() {
|
|
29661
29660
|
return this.type.getReductionSource();
|
|
29662
29661
|
}
|
|
29663
29662
|
getContainer() {
|
|
29664
|
-
return createTypeEntityContainer(this.type.
|
|
29663
|
+
return createTypeEntityContainer(this.type.entity);
|
|
29665
29664
|
}
|
|
29666
29665
|
};
|
|
29667
29666
|
var ReducedTypeUsage_entity = class {
|
|
@@ -29688,7 +29687,7 @@ var ParameterTypeUsage_type = class {
|
|
|
29688
29687
|
this.kind = "parameter";
|
|
29689
29688
|
}
|
|
29690
29689
|
getEntity() {
|
|
29691
|
-
return this.type.
|
|
29690
|
+
return this.type.entity;
|
|
29692
29691
|
}
|
|
29693
29692
|
isNullExcluded() {
|
|
29694
29693
|
return this.type.isNullExcluded;
|
|
@@ -30524,7 +30523,7 @@ var DisplayServiceA = class extends BaseDisplayService {
|
|
|
30524
30523
|
}
|
|
30525
30524
|
return types.map((t) => {
|
|
30526
30525
|
let typeText = this.displayTypeInternal(t, lessDetailsTypeDisplayOptions);
|
|
30527
|
-
if (t.kind === "function" && t.
|
|
30526
|
+
if (t.kind === "function" && t.entity.getNaming().kind === "anonymous") {
|
|
30528
30527
|
typeText = `(${typeText})`;
|
|
30529
30528
|
}
|
|
30530
30529
|
return typeText;
|
|
@@ -31145,7 +31144,7 @@ var DisplayServiceM = class extends BaseDisplayService {
|
|
|
31145
31144
|
}
|
|
31146
31145
|
return types.map((t) => {
|
|
31147
31146
|
let typeText = this.displayTypeInternal(t, lessDetailsTypeDisplayOptions2);
|
|
31148
|
-
if (t.kind === "function" && t.
|
|
31147
|
+
if (t.kind === "function" && t.entity.getNaming().kind === "anonymous") {
|
|
31149
31148
|
typeText = `(${typeText})`;
|
|
31150
31149
|
}
|
|
31151
31150
|
return typeText;
|
|
@@ -31600,9 +31599,8 @@ var OriginalBaseAspectTypes = class extends BaseAspectTypes {
|
|
|
31600
31599
|
for (const declaredAspect of this.declared) {
|
|
31601
31600
|
const unaliased = declaredAspect.unaliasAndGetReductionSource();
|
|
31602
31601
|
if (unaliased.kind === "structured") {
|
|
31603
|
-
|
|
31604
|
-
|
|
31605
|
-
baseTypeEntity.getBaseObjectType().resolveBaseObjectType(circularityTrackingStack);
|
|
31602
|
+
unaliased.entity.getBaseAspectTypes().resolveBaseAspectTypes(circularityTrackingStack);
|
|
31603
|
+
unaliased.entity.getBaseObjectType().resolveBaseObjectType(circularityTrackingStack);
|
|
31606
31604
|
}
|
|
31607
31605
|
if (!circularityTrackingStack[stackIndex]) {
|
|
31608
31606
|
cycleFreeAspects.push(declaredAspect);
|
|
@@ -31670,9 +31668,8 @@ var OriginalBaseObjectType = class extends BaseObjectType {
|
|
|
31670
31668
|
if (this.declared !== void 0) {
|
|
31671
31669
|
const declared = this.declared.unaliasAndGetReductionSource();
|
|
31672
31670
|
if (declared.kind === "structured") {
|
|
31673
|
-
|
|
31674
|
-
|
|
31675
|
-
baseTypeEntity.getBaseAspectTypes().resolveBaseAspectTypes(circularityTrackingStack);
|
|
31671
|
+
declared.entity.getBaseObjectType().resolveBaseObjectType(circularityTrackingStack);
|
|
31672
|
+
declared.entity.getBaseAspectTypes().resolveBaseAspectTypes(circularityTrackingStack);
|
|
31676
31673
|
}
|
|
31677
31674
|
}
|
|
31678
31675
|
let result;
|
|
@@ -31825,12 +31822,12 @@ var TypeMemberEntity;
|
|
|
31825
31822
|
((TypeMemberEntity12) => {
|
|
31826
31823
|
function isAspectMember(entity) {
|
|
31827
31824
|
const containingEntity = entity.getContainingEntity();
|
|
31828
|
-
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.
|
|
31825
|
+
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.structuredTypeKind === 2 /* Aspect */;
|
|
31829
31826
|
}
|
|
31830
31827
|
TypeMemberEntity12.isAspectMember = isAspectMember;
|
|
31831
31828
|
function isClassMember(entity) {
|
|
31832
31829
|
const containingEntity = entity.getContainingEntity();
|
|
31833
|
-
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.
|
|
31830
|
+
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.structuredTypeKind === 0 /* Class */;
|
|
31834
31831
|
}
|
|
31835
31832
|
TypeMemberEntity12.isClassMember = isClassMember;
|
|
31836
31833
|
function isReducedTypeMember(entity) {
|
|
@@ -31839,15 +31836,7 @@ var TypeMemberEntity;
|
|
|
31839
31836
|
}
|
|
31840
31837
|
TypeMemberEntity12.isReducedTypeMember = isReducedTypeMember;
|
|
31841
31838
|
function isBasic(entity) {
|
|
31842
|
-
|
|
31843
|
-
case 0 /* Variable */:
|
|
31844
|
-
case 1 /* Function */:
|
|
31845
|
-
case 3 /* Indexer */:
|
|
31846
|
-
case 4 /* DereferenceOperator */:
|
|
31847
|
-
return !entity.isStatic() && (entity.markedBasic() || entity.markedAbstract());
|
|
31848
|
-
default:
|
|
31849
|
-
Debug.never(entity);
|
|
31850
|
-
}
|
|
31839
|
+
return !entity.isStatic() && (entity.markedBasic() || entity.markedAbstract());
|
|
31851
31840
|
}
|
|
31852
31841
|
TypeMemberEntity12.isBasic = isBasic;
|
|
31853
31842
|
function isAbstract(entity) {
|
|
@@ -32199,32 +32188,32 @@ var EntityLocalizationContext = class {
|
|
|
32199
32188
|
switch (type.kind) {
|
|
32200
32189
|
case "structured":
|
|
32201
32190
|
return this.analyzer.typeFactory.getStructuredType(
|
|
32202
|
-
this.getLocalizedStructuredTypeEntity(type.
|
|
32203
|
-
this.createLocalizedSubstitutions(type.
|
|
32191
|
+
this.getLocalizedStructuredTypeEntity(type.entity),
|
|
32192
|
+
this.createLocalizedSubstitutions(type.substitutions)
|
|
32204
32193
|
);
|
|
32205
32194
|
case "function":
|
|
32206
32195
|
return this.analyzer.typeFactory.getFunctionType(
|
|
32207
|
-
this.getLocalizedFunctionTypeEntity(type.
|
|
32208
|
-
this.createLocalizedSubstitutions(type.
|
|
32196
|
+
this.getLocalizedFunctionTypeEntity(type.entity),
|
|
32197
|
+
this.createLocalizedSubstitutions(type.substitutions)
|
|
32209
32198
|
);
|
|
32210
32199
|
case "variant":
|
|
32211
32200
|
return this.analyzer.typeFactory.getVariantType(
|
|
32212
|
-
this.getLocalizedVariantTypeEntity(type.
|
|
32213
|
-
this.createLocalizedSubstitutions(type.
|
|
32201
|
+
this.getLocalizedVariantTypeEntity(type.entity),
|
|
32202
|
+
this.createLocalizedSubstitutions(type.substitutions)
|
|
32214
32203
|
);
|
|
32215
32204
|
case "alias":
|
|
32216
32205
|
return this.analyzer.typeFactory.getAliasType(
|
|
32217
|
-
this.getLocalizedAliasTypeEntity(type.
|
|
32218
|
-
this.createLocalizedSubstitutions(type.
|
|
32206
|
+
this.getLocalizedAliasTypeEntity(type.entity),
|
|
32207
|
+
this.createLocalizedSubstitutions(type.substitutions)
|
|
32219
32208
|
);
|
|
32220
32209
|
case "reduced":
|
|
32221
32210
|
return this.analyzer.typeFactory.getReducedType(
|
|
32222
|
-
this.getLocalizedReducedTypeEntity(type.
|
|
32223
|
-
this.createLocalizedSubstitutions(type.
|
|
32211
|
+
this.getLocalizedReducedTypeEntity(type.entity),
|
|
32212
|
+
this.createLocalizedSubstitutions(type.substitutions)
|
|
32224
32213
|
);
|
|
32225
32214
|
case "parameter":
|
|
32226
32215
|
return this.analyzer.typeFactory.getParameterType(
|
|
32227
|
-
this.getLocalizedTypeParameterEntity(type.
|
|
32216
|
+
this.getLocalizedTypeParameterEntity(type.entity),
|
|
32228
32217
|
type.isNullExcluded
|
|
32229
32218
|
);
|
|
32230
32219
|
case "unresolved":
|
|
@@ -32472,10 +32461,10 @@ var OriginalAliasedType = class extends AliasedType {
|
|
|
32472
32461
|
case "parameter":
|
|
32473
32462
|
break;
|
|
32474
32463
|
case "alias":
|
|
32475
|
-
type.
|
|
32464
|
+
type.entity.getAliasedType().resolveAliasedType(circularityTrackingStack);
|
|
32476
32465
|
break;
|
|
32477
32466
|
case "reduced":
|
|
32478
|
-
type.
|
|
32467
|
+
type.entity.getReductionSource().resolveReductionSource(circularityTrackingStack);
|
|
32479
32468
|
break;
|
|
32480
32469
|
case "union":
|
|
32481
32470
|
for (const constituentType of type.originalTypes) {
|
|
@@ -32904,10 +32893,10 @@ var OriginalReductionSource = class extends ReductionSource {
|
|
|
32904
32893
|
case "parameter":
|
|
32905
32894
|
break;
|
|
32906
32895
|
case "alias":
|
|
32907
|
-
type.
|
|
32896
|
+
type.entity.getAliasedType().resolveAliasedType(circularityTrackingStack);
|
|
32908
32897
|
break;
|
|
32909
32898
|
case "reduced":
|
|
32910
|
-
type.
|
|
32899
|
+
type.entity.getReductionSource().resolveReductionSource(circularityTrackingStack);
|
|
32911
32900
|
break;
|
|
32912
32901
|
case "union":
|
|
32913
32902
|
for (const constituentType of type.originalTypes) {
|
|
@@ -33129,7 +33118,7 @@ var OriginalTypeParameterConstraint = class extends TypeParameterConstraint {
|
|
|
33129
33118
|
this.state = { kind: "resolving", stackIndex: circularityTrackingStack.length };
|
|
33130
33119
|
circularityTrackingStack.push(false);
|
|
33131
33120
|
try {
|
|
33132
|
-
this.declared.
|
|
33121
|
+
this.declared.entity.getConstraint().resolveConstraint(circularityTrackingStack);
|
|
33133
33122
|
let result;
|
|
33134
33123
|
if (circularityTrackingStack[this.state.stackIndex]) {
|
|
33135
33124
|
result = new CycleFreeConstraintResolutionResult(void 0, true);
|
|
@@ -34327,14 +34316,14 @@ var IntrinsicPackageStructuredTypeEntity = class {
|
|
|
34327
34316
|
/**
|
|
34328
34317
|
* После создания необходимо вызывать setMembers.
|
|
34329
34318
|
*/
|
|
34330
|
-
constructor(analyzer, name, containingPackage, typeParameters, isBasic_, isAbstract_,
|
|
34319
|
+
constructor(analyzer, name, containingPackage, typeParameters, isBasic_, isAbstract_, structuredTypeKind_, baseObjectType, baseAspectTypes, isHidden_, substitutionApplicationMode_) {
|
|
34331
34320
|
this.analyzer = analyzer;
|
|
34332
34321
|
this.name = name;
|
|
34333
34322
|
this.containingPackage = containingPackage;
|
|
34334
34323
|
this.typeParameters = typeParameters;
|
|
34335
34324
|
this.isBasic_ = isBasic_;
|
|
34336
34325
|
this.isAbstract_ = isAbstract_;
|
|
34337
|
-
this.
|
|
34326
|
+
this.structuredTypeKind_ = structuredTypeKind_;
|
|
34338
34327
|
this.baseObjectType = baseObjectType;
|
|
34339
34328
|
this.baseAspectTypes = baseAspectTypes;
|
|
34340
34329
|
this.isHidden_ = isHidden_;
|
|
@@ -34345,6 +34334,9 @@ var IntrinsicPackageStructuredTypeEntity = class {
|
|
|
34345
34334
|
this.safeBaseObjectType = new Cached();
|
|
34346
34335
|
this.safeBaseAspectTypes = new Cached();
|
|
34347
34336
|
}
|
|
34337
|
+
get structuredTypeKind() {
|
|
34338
|
+
return this.structuredTypeKind_;
|
|
34339
|
+
}
|
|
34348
34340
|
getNaming() {
|
|
34349
34341
|
return new EntityNaming_named(this.name);
|
|
34350
34342
|
}
|
|
@@ -34374,9 +34366,6 @@ var IntrinsicPackageStructuredTypeEntity = class {
|
|
|
34374
34366
|
isAbstract() {
|
|
34375
34367
|
return this.isAbstract_;
|
|
34376
34368
|
}
|
|
34377
|
-
getStructuredTypeKind() {
|
|
34378
|
-
return this._structuredTypeKind;
|
|
34379
|
-
}
|
|
34380
34369
|
getArity() {
|
|
34381
34370
|
return this.typeParameters.length;
|
|
34382
34371
|
}
|
|
@@ -34436,10 +34425,10 @@ var IntrinsicAnonymousStructuredTypeEntity = class {
|
|
|
34436
34425
|
/**
|
|
34437
34426
|
* После создания необходимо вызывать setMembers.
|
|
34438
34427
|
*/
|
|
34439
|
-
constructor(analyzer, typeParameters,
|
|
34428
|
+
constructor(analyzer, typeParameters, structuredTypeKind_, baseObjectType, baseAspectTypes, isHidden_, substitutionApplicationMode, containingPackage) {
|
|
34440
34429
|
this.analyzer = analyzer;
|
|
34441
34430
|
this.typeParameters = typeParameters;
|
|
34442
|
-
this.
|
|
34431
|
+
this.structuredTypeKind_ = structuredTypeKind_;
|
|
34443
34432
|
this.baseObjectType = baseObjectType;
|
|
34444
34433
|
this.baseAspectTypes = baseAspectTypes;
|
|
34445
34434
|
this.isHidden_ = isHidden_;
|
|
@@ -34451,6 +34440,9 @@ var IntrinsicAnonymousStructuredTypeEntity = class {
|
|
|
34451
34440
|
this.safeBaseObjectType = new Cached();
|
|
34452
34441
|
this.safeBaseAspectTypes = new Cached();
|
|
34453
34442
|
}
|
|
34443
|
+
get structuredTypeKind() {
|
|
34444
|
+
return this.structuredTypeKind_;
|
|
34445
|
+
}
|
|
34454
34446
|
getNaming() {
|
|
34455
34447
|
return new EntityNaming_anonymous();
|
|
34456
34448
|
}
|
|
@@ -34474,9 +34466,6 @@ var IntrinsicAnonymousStructuredTypeEntity = class {
|
|
|
34474
34466
|
isAbstract() {
|
|
34475
34467
|
return false;
|
|
34476
34468
|
}
|
|
34477
|
-
getStructuredTypeKind() {
|
|
34478
|
-
return this._structuredTypeKind;
|
|
34479
|
-
}
|
|
34480
34469
|
getArity() {
|
|
34481
34470
|
return this.typeParameters.length;
|
|
34482
34471
|
}
|
|
@@ -41070,7 +41059,7 @@ var EntityMap = class _EntityMap {
|
|
|
41070
41059
|
this.analyzer.originalWellKnownDeclarations.fieldProxy
|
|
41071
41060
|
));
|
|
41072
41061
|
if (proxyTag !== void 0) {
|
|
41073
|
-
const originalTagEntity = proxyTag.type.
|
|
41062
|
+
const originalTagEntity = proxyTag.type.entity;
|
|
41074
41063
|
Debug.assertNotNull(originalTagEntity, "\u0422\u0438\u043F \u0442\u0435\u0433\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u043E\u044E\u0437\u043D\u044B\u043C \u0438\u043B\u0438 \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u043C.");
|
|
41075
41064
|
result.details.isProxiedField = {
|
|
41076
41065
|
tagType: this.getTypeOrExtensionEntity(originalTagEntity),
|
|
@@ -41292,8 +41281,7 @@ var EntityMap = class _EntityMap {
|
|
|
41292
41281
|
Debug.never(entity);
|
|
41293
41282
|
}
|
|
41294
41283
|
result.typeOrExtensionKind = 0 /* StructuredType */;
|
|
41295
|
-
|
|
41296
|
-
switch (structuredTypeKind) {
|
|
41284
|
+
switch (entity.structuredTypeKind) {
|
|
41297
41285
|
case 0 /* Class */:
|
|
41298
41286
|
result.details.structuredTypeKind = 0 /* Class */;
|
|
41299
41287
|
break;
|
|
@@ -41304,16 +41292,15 @@ var EntityMap = class _EntityMap {
|
|
|
41304
41292
|
result.details.structuredTypeKind = 2 /* Aspect */;
|
|
41305
41293
|
break;
|
|
41306
41294
|
default:
|
|
41307
|
-
Debug.never(structuredTypeKind);
|
|
41295
|
+
Debug.never(entity.structuredTypeKind);
|
|
41308
41296
|
}
|
|
41309
|
-
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.
|
|
41297
|
+
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.entity;
|
|
41310
41298
|
if (baseTypeEntity !== void 0) {
|
|
41311
41299
|
result.baseObjectType = this.unaliasTypeEntity(this.getTypeOrExtensionEntity(baseTypeEntity));
|
|
41312
41300
|
}
|
|
41313
41301
|
result.baseAspectTypes = Query.from(entity.getBaseAspectTypes().cycleFree).mapAndFilter((t) => {
|
|
41314
|
-
|
|
41315
|
-
|
|
41316
|
-
return this.unaliasTypeEntity(this.getTypeOrExtensionEntity(entity2));
|
|
41302
|
+
if (t.entity !== void 0) {
|
|
41303
|
+
return this.unaliasTypeEntity(this.getTypeOrExtensionEntity(t.entity));
|
|
41317
41304
|
} else {
|
|
41318
41305
|
return void 0;
|
|
41319
41306
|
}
|
|
@@ -41342,7 +41329,7 @@ var EntityMap = class _EntityMap {
|
|
|
41342
41329
|
result.containingPackage = this.getContainingPackageAndAccumulateIfMember(entity, result);
|
|
41343
41330
|
result.name = this.getEntityNameText(entity);
|
|
41344
41331
|
result.typeOrExtensionKind = 3 /* VariantType */;
|
|
41345
|
-
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.
|
|
41332
|
+
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.entity;
|
|
41346
41333
|
if (baseTypeEntity !== void 0) {
|
|
41347
41334
|
result.baseObjectType = this.unaliasTypeEntity(this.getTypeOrExtensionEntity(baseTypeEntity));
|
|
41348
41335
|
}
|
|
@@ -41384,7 +41371,7 @@ var EntityMap = class _EntityMap {
|
|
|
41384
41371
|
result.containingPackage = this.getContainingPackageAndAccumulateIfMember(entity, result);
|
|
41385
41372
|
result.name = EmitPhaseName.ofAnonymousType(result.containingPackage.locale);
|
|
41386
41373
|
result.typeOrExtensionKind = 4 /* FunctionType */;
|
|
41387
|
-
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.
|
|
41374
|
+
const baseTypeEntity = entity.getBaseObjectType().cycleFree?.entity;
|
|
41388
41375
|
if (baseTypeEntity !== void 0) {
|
|
41389
41376
|
result.baseObjectType = this.unaliasTypeEntity(this.getTypeOrExtensionEntity(baseTypeEntity));
|
|
41390
41377
|
}
|
|
@@ -41489,8 +41476,8 @@ var EntityMap = class _EntityMap {
|
|
|
41489
41476
|
case "alias":
|
|
41490
41477
|
case "reduced":
|
|
41491
41478
|
case "parameter": {
|
|
41492
|
-
const entity = this.getTypeOrExtensionEntity(type.
|
|
41493
|
-
const typeArguments = Query.from(type.
|
|
41479
|
+
const entity = this.getTypeOrExtensionEntity(type.entity);
|
|
41480
|
+
const typeArguments = Query.from(type.substitutions.getTypes()).map((t) => this.getType(t)).toArray();
|
|
41494
41481
|
return new SimpleType(entity, typeArguments);
|
|
41495
41482
|
}
|
|
41496
41483
|
case "union": {
|
|
@@ -49585,7 +49572,7 @@ var IrBuilderA = class {
|
|
|
49585
49572
|
const args = this.buildArgumentList(expression.argumentList, parameters);
|
|
49586
49573
|
const isAsyncFunctionCall = meaning.type.isAsync();
|
|
49587
49574
|
const returnType = this.entityMap.getType(meaning.type.getReturnType());
|
|
49588
|
-
const isCallOfFunctionWithObjectParameter = findObjectParameter(meaning.type.
|
|
49575
|
+
const isCallOfFunctionWithObjectParameter = findObjectParameter(meaning.type.entity.getParameters()) !== void 0;
|
|
49589
49576
|
return callExpression(
|
|
49590
49577
|
irExpression,
|
|
49591
49578
|
isOptionalAccess,
|
|
@@ -50128,17 +50115,17 @@ var IrBuilderA = class {
|
|
|
50128
50115
|
getEntityFromType(type) {
|
|
50129
50116
|
switch (type.kind) {
|
|
50130
50117
|
case "structured":
|
|
50131
|
-
return this.entityMap.getStructuredTypeEntity(type.
|
|
50118
|
+
return this.entityMap.getStructuredTypeEntity(type.entity);
|
|
50132
50119
|
case "variant":
|
|
50133
|
-
return this.entityMap.getVariantTypeEntity(type.
|
|
50120
|
+
return this.entityMap.getVariantTypeEntity(type.entity);
|
|
50134
50121
|
case "function":
|
|
50135
|
-
return this.entityMap.getFunctionTypeEntity(type.
|
|
50122
|
+
return this.entityMap.getFunctionTypeEntity(type.entity);
|
|
50136
50123
|
case "alias":
|
|
50137
|
-
return this.entityMap.getAliasTypeEntity(type.
|
|
50124
|
+
return this.entityMap.getAliasTypeEntity(type.entity);
|
|
50138
50125
|
case "reduced":
|
|
50139
|
-
return this.entityMap.getReducedTypeEntity(type.
|
|
50126
|
+
return this.entityMap.getReducedTypeEntity(type.entity);
|
|
50140
50127
|
case "parameter":
|
|
50141
|
-
return this.entityMap.getTypeParameterEntity(type.
|
|
50128
|
+
return this.entityMap.getTypeParameterEntity(type.entity);
|
|
50142
50129
|
case "unresolved":
|
|
50143
50130
|
throw new EmitterError("Invalid or unresolved type");
|
|
50144
50131
|
case "substitution-stub":
|
|
@@ -51798,6 +51785,51 @@ __decorateClass([
|
|
|
51798
51785
|
], _IrToJs.prototype, "convertDecorator", 1);
|
|
51799
51786
|
var IrToJs = _IrToJs;
|
|
51800
51787
|
|
|
51788
|
+
// source/analysis/m/TextIdentity.ts
|
|
51789
|
+
var TextIdentity = class _TextIdentity {
|
|
51790
|
+
static keyFromTextLiteralSuffix(node) {
|
|
51791
|
+
let result;
|
|
51792
|
+
if (node.suffix !== void 0 && node.suffix.value !== "!") {
|
|
51793
|
+
result = Name.parse(node.suffix.value.slice(1)).key;
|
|
51794
|
+
}
|
|
51795
|
+
return result;
|
|
51796
|
+
}
|
|
51797
|
+
static keyFromLocalizableTextLiteral(node) {
|
|
51798
|
+
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51799
|
+
if (key !== void 0) {
|
|
51800
|
+
return key;
|
|
51801
|
+
}
|
|
51802
|
+
return unescapeText(withoutQuotes(node.text.value));
|
|
51803
|
+
}
|
|
51804
|
+
static keyFromLocalizableTextTemplateLiteral(node) {
|
|
51805
|
+
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51806
|
+
if (key !== void 0) {
|
|
51807
|
+
return key;
|
|
51808
|
+
}
|
|
51809
|
+
const fragments = [unescapeText(withoutTemplateQuotes(node.head.value))];
|
|
51810
|
+
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
51811
|
+
return fragments.join("_");
|
|
51812
|
+
}
|
|
51813
|
+
static keyFromTextTranslationSource(node) {
|
|
51814
|
+
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51815
|
+
if (key !== void 0) {
|
|
51816
|
+
return key;
|
|
51817
|
+
}
|
|
51818
|
+
switch (node.kind) {
|
|
51819
|
+
case 1120 /* TranslationTextLiteral */: {
|
|
51820
|
+
return unescapeText(withoutQuotes(node.text.value));
|
|
51821
|
+
}
|
|
51822
|
+
case 1121 /* TranslationTextTemplate */: {
|
|
51823
|
+
const fragments = [unescapeText(withoutTemplateQuotes(node.head.value))];
|
|
51824
|
+
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
51825
|
+
return fragments.join("_");
|
|
51826
|
+
}
|
|
51827
|
+
default:
|
|
51828
|
+
Debug.never(node);
|
|
51829
|
+
}
|
|
51830
|
+
}
|
|
51831
|
+
};
|
|
51832
|
+
|
|
51801
51833
|
// source/analysis/m/TreeQuery.ts
|
|
51802
51834
|
var TreeQuery2 = class {
|
|
51803
51835
|
static getSourceFile(node, analyzer) {
|
|
@@ -51869,51 +51901,6 @@ var TypeMemberQuery2 = class {
|
|
|
51869
51901
|
}
|
|
51870
51902
|
};
|
|
51871
51903
|
|
|
51872
|
-
// source/analysis/m/TextIdentity.ts
|
|
51873
|
-
var TextIdentity = class _TextIdentity {
|
|
51874
|
-
static keyFromTextLiteralSuffix(node) {
|
|
51875
|
-
let result;
|
|
51876
|
-
if (node.suffix !== void 0 && node.suffix.value !== "!") {
|
|
51877
|
-
result = Name.parse(node.suffix.value.slice(1)).key;
|
|
51878
|
-
}
|
|
51879
|
-
return result;
|
|
51880
|
-
}
|
|
51881
|
-
static keyFromLocalizableTextLiteral(node) {
|
|
51882
|
-
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51883
|
-
if (key !== void 0) {
|
|
51884
|
-
return key;
|
|
51885
|
-
}
|
|
51886
|
-
return unescapeText(withoutQuotes(node.text.value));
|
|
51887
|
-
}
|
|
51888
|
-
static keyFromLocalizableTextTemplateLiteral(node) {
|
|
51889
|
-
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51890
|
-
if (key !== void 0) {
|
|
51891
|
-
return key;
|
|
51892
|
-
}
|
|
51893
|
-
const fragments = [unescapeText(withoutTemplateQuotes(node.head.value))];
|
|
51894
|
-
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
51895
|
-
return fragments.join("_");
|
|
51896
|
-
}
|
|
51897
|
-
static keyFromTextTranslationSource(node) {
|
|
51898
|
-
const key = _TextIdentity.keyFromTextLiteralSuffix(node);
|
|
51899
|
-
if (key !== void 0) {
|
|
51900
|
-
return key;
|
|
51901
|
-
}
|
|
51902
|
-
switch (node.kind) {
|
|
51903
|
-
case 1120 /* TranslationTextLiteral */: {
|
|
51904
|
-
return unescapeText(withoutQuotes(node.text.value));
|
|
51905
|
-
}
|
|
51906
|
-
case 1121 /* TranslationTextTemplate */: {
|
|
51907
|
-
const fragments = [unescapeText(withoutTemplateQuotes(node.head.value))];
|
|
51908
|
-
node.spanList.spans.forEach((x) => fragments.push(unescapeText(withoutTemplateQuotes(x.text.value))));
|
|
51909
|
-
return fragments.join("_");
|
|
51910
|
-
}
|
|
51911
|
-
default:
|
|
51912
|
-
Debug.never(node);
|
|
51913
|
-
}
|
|
51914
|
-
}
|
|
51915
|
-
};
|
|
51916
|
-
|
|
51917
51904
|
// source/emitter/IrBuilderM.ts
|
|
51918
51905
|
var IrBuilderM = class {
|
|
51919
51906
|
constructor(ectx, entityMap, declarationUsageInfoOfAllPackages) {
|
|
@@ -53131,7 +53118,7 @@ var IrBuilderM = class {
|
|
|
53131
53118
|
const args = this.buildArgumentList(expression.argumentList, parameters);
|
|
53132
53119
|
const isAsyncFunctionCall = meaning.type.isAsync();
|
|
53133
53120
|
const returnType = this.entityMap.getType(meaning.type.getReturnType());
|
|
53134
|
-
const isCallOfFunctionWithObjectParameter = findObjectParameter(meaning.type.
|
|
53121
|
+
const isCallOfFunctionWithObjectParameter = findObjectParameter(meaning.type.entity.getParameters()) !== void 0;
|
|
53135
53122
|
return callExpression(
|
|
53136
53123
|
irExpression,
|
|
53137
53124
|
isOptionalAccess,
|
|
@@ -53644,17 +53631,17 @@ var IrBuilderM = class {
|
|
|
53644
53631
|
getEntityFromType(type) {
|
|
53645
53632
|
switch (type.kind) {
|
|
53646
53633
|
case "structured":
|
|
53647
|
-
return this.entityMap.getStructuredTypeEntity(type.
|
|
53634
|
+
return this.entityMap.getStructuredTypeEntity(type.entity);
|
|
53648
53635
|
case "variant":
|
|
53649
|
-
return this.entityMap.getVariantTypeEntity(type.
|
|
53636
|
+
return this.entityMap.getVariantTypeEntity(type.entity);
|
|
53650
53637
|
case "function":
|
|
53651
|
-
return this.entityMap.getFunctionTypeEntity(type.
|
|
53638
|
+
return this.entityMap.getFunctionTypeEntity(type.entity);
|
|
53652
53639
|
case "alias":
|
|
53653
|
-
return this.entityMap.getAliasTypeEntity(type.
|
|
53640
|
+
return this.entityMap.getAliasTypeEntity(type.entity);
|
|
53654
53641
|
case "reduced":
|
|
53655
|
-
return this.entityMap.getReducedTypeEntity(type.
|
|
53642
|
+
return this.entityMap.getReducedTypeEntity(type.entity);
|
|
53656
53643
|
case "parameter":
|
|
53657
|
-
return this.entityMap.getTypeParameterEntity(type.
|
|
53644
|
+
return this.entityMap.getTypeParameterEntity(type.entity);
|
|
53658
53645
|
case "unresolved":
|
|
53659
53646
|
throw new EmitterError("Invalid or unresolved type");
|
|
53660
53647
|
case "substitution-stub":
|
|
@@ -55019,7 +55006,7 @@ var BaseType = class {
|
|
|
55019
55006
|
}
|
|
55020
55007
|
isPossiblyAliasedOrReducedStructure() {
|
|
55021
55008
|
const type = this.asType.unaliasAndGetReductionSource();
|
|
55022
|
-
return type.kind === "structured" && type.
|
|
55009
|
+
return type.kind === "structured" && type.structuredTypeKind === 1 /* Structure */;
|
|
55023
55010
|
}
|
|
55024
55011
|
toString() {
|
|
55025
55012
|
return new DisplayService(this.analyzer, 1 /* Ru */, DefaultDialect).displayType(this.asType);
|
|
@@ -55044,9 +55031,6 @@ var AliasType = class extends BaseType {
|
|
|
55044
55031
|
getTypeParameters() {
|
|
55045
55032
|
return this.entity.getTypeParameters();
|
|
55046
55033
|
}
|
|
55047
|
-
getSubstitutions() {
|
|
55048
|
-
return this.substitutions;
|
|
55049
|
-
}
|
|
55050
55034
|
applySubstitutions(substitutions) {
|
|
55051
55035
|
if (substitutions.size === 0) {
|
|
55052
55036
|
return this;
|
|
@@ -55073,9 +55057,6 @@ var AliasType = class extends BaseType {
|
|
|
55073
55057
|
equals(other, considerLocale = false) {
|
|
55074
55058
|
return this === other || other.kind === "alias" && (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.substitutions, considerLocale);
|
|
55075
55059
|
}
|
|
55076
|
-
getEntity() {
|
|
55077
|
-
return this.entity;
|
|
55078
|
-
}
|
|
55079
55060
|
};
|
|
55080
55061
|
|
|
55081
55062
|
// source/types/collections/TypeDictionary.ts
|
|
@@ -55165,7 +55146,7 @@ var TypeDictionary = class {
|
|
|
55165
55146
|
if (key.kind === "function") {
|
|
55166
55147
|
return this.bucketForTypesWithoutEntity;
|
|
55167
55148
|
}
|
|
55168
|
-
let entity = key.
|
|
55149
|
+
let entity = key.entity;
|
|
55169
55150
|
if (entity === void 0) {
|
|
55170
55151
|
return this.bucketForTypesWithoutEntity;
|
|
55171
55152
|
}
|
|
@@ -55180,7 +55161,7 @@ var TypeDictionary = class {
|
|
|
55180
55161
|
return bucket;
|
|
55181
55162
|
}
|
|
55182
55163
|
getExistingBucket(key) {
|
|
55183
|
-
let entity = key.
|
|
55164
|
+
let entity = key.entity;
|
|
55184
55165
|
if (entity === void 0) {
|
|
55185
55166
|
return this.bucketForTypesWithoutEntity;
|
|
55186
55167
|
}
|
|
@@ -55483,7 +55464,7 @@ var TypeSet = class _TypeSet {
|
|
|
55483
55464
|
if (key.kind === "function") {
|
|
55484
55465
|
return this.bucketForTypesWithoutEntity;
|
|
55485
55466
|
}
|
|
55486
|
-
let entity = key.
|
|
55467
|
+
let entity = key.entity;
|
|
55487
55468
|
if (entity === void 0) {
|
|
55488
55469
|
return this.bucketForTypesWithoutEntity;
|
|
55489
55470
|
}
|
|
@@ -55498,7 +55479,7 @@ var TypeSet = class _TypeSet {
|
|
|
55498
55479
|
return bucket;
|
|
55499
55480
|
}
|
|
55500
55481
|
getExistingBucket(key) {
|
|
55501
|
-
let entity = key.
|
|
55482
|
+
let entity = key.entity;
|
|
55502
55483
|
if (entity === void 0) {
|
|
55503
55484
|
return this.bucketForTypesWithoutEntity;
|
|
55504
55485
|
}
|
|
@@ -55954,9 +55935,6 @@ var FunctionType = class extends BaseType {
|
|
|
55954
55935
|
getTypeParameters() {
|
|
55955
55936
|
return this.entity.getTypeParameters();
|
|
55956
55937
|
}
|
|
55957
|
-
getSubstitutions() {
|
|
55958
|
-
return this.substitutions;
|
|
55959
|
-
}
|
|
55960
55938
|
applySubstitutions(substitutions) {
|
|
55961
55939
|
if (substitutions.size === 0) {
|
|
55962
55940
|
return this;
|
|
@@ -56001,9 +55979,6 @@ var FunctionType = class extends BaseType {
|
|
|
56001
55979
|
}
|
|
56002
55980
|
return (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.substitutions, considerLocale);
|
|
56003
55981
|
}
|
|
56004
|
-
getEntity() {
|
|
56005
|
-
return this.entity;
|
|
56006
|
-
}
|
|
56007
55982
|
isAsync() {
|
|
56008
55983
|
return this.entity.isAsync();
|
|
56009
55984
|
}
|
|
@@ -56026,6 +56001,12 @@ var IntersectionType = class extends BaseType {
|
|
|
56026
56001
|
this.unaliasedFlattenedTypes_ = new Cached();
|
|
56027
56002
|
this.originalTypes = originalTypes;
|
|
56028
56003
|
}
|
|
56004
|
+
get entity() {
|
|
56005
|
+
return void 0;
|
|
56006
|
+
}
|
|
56007
|
+
get substitutions() {
|
|
56008
|
+
return Substitutions.empty();
|
|
56009
|
+
}
|
|
56029
56010
|
get unaliasedFlattenedTypes() {
|
|
56030
56011
|
return this.unaliasedFlattenedTypes_.getOrInsertWith(() => this.unaliasAndFlattenTypes());
|
|
56031
56012
|
}
|
|
@@ -56039,9 +56020,6 @@ var IntersectionType = class extends BaseType {
|
|
|
56039
56020
|
(t1, t2) => t1.equals(t2, considerLocale)
|
|
56040
56021
|
);
|
|
56041
56022
|
}
|
|
56042
|
-
getSubstitutions() {
|
|
56043
|
-
return Substitutions.empty();
|
|
56044
|
-
}
|
|
56045
56023
|
applySubstitutions(substitutions) {
|
|
56046
56024
|
if (substitutions.size === 0) {
|
|
56047
56025
|
return this;
|
|
@@ -56058,9 +56036,6 @@ var IntersectionType = class extends BaseType {
|
|
|
56058
56036
|
}
|
|
56059
56037
|
return this.analyzer.typeFactory.getIntersectionType(types);
|
|
56060
56038
|
}
|
|
56061
|
-
getEntity() {
|
|
56062
|
-
return void 0;
|
|
56063
|
-
}
|
|
56064
56039
|
unaliasAndFlattenTypes() {
|
|
56065
56040
|
const originalTypes = this.originalTypes;
|
|
56066
56041
|
if (!originalTypes.some((t) => t.kind === "alias")) {
|
|
@@ -56088,6 +56063,9 @@ var ParameterType = class extends BaseType {
|
|
|
56088
56063
|
this.entity = entity;
|
|
56089
56064
|
this.isNullExcluded = isNullExcluded;
|
|
56090
56065
|
}
|
|
56066
|
+
get substitutions() {
|
|
56067
|
+
return Substitutions.empty();
|
|
56068
|
+
}
|
|
56091
56069
|
/**
|
|
56092
56070
|
* Ограничение параметра типа с учётом флага {@link isNullExcluded}.
|
|
56093
56071
|
*/
|
|
@@ -56103,12 +56081,6 @@ var ParameterType = class extends BaseType {
|
|
|
56103
56081
|
get asType() {
|
|
56104
56082
|
return this;
|
|
56105
56083
|
}
|
|
56106
|
-
getSubstitutions() {
|
|
56107
|
-
return Substitutions.empty();
|
|
56108
|
-
}
|
|
56109
|
-
getEntity() {
|
|
56110
|
-
return this.entity;
|
|
56111
|
-
}
|
|
56112
56084
|
applySubstitutions(substitutions) {
|
|
56113
56085
|
return substitutions.map.get(this.entity.getOriginalEntity()) ?? this;
|
|
56114
56086
|
}
|
|
@@ -56143,9 +56115,6 @@ var ReducedType = class extends BaseType {
|
|
|
56143
56115
|
getTypeParameters() {
|
|
56144
56116
|
return this.entity.getTypeParameters();
|
|
56145
56117
|
}
|
|
56146
|
-
getSubstitutions() {
|
|
56147
|
-
return this.substitutions;
|
|
56148
|
-
}
|
|
56149
56118
|
applySubstitutions(substitutions) {
|
|
56150
56119
|
if (substitutions.size === 0) {
|
|
56151
56120
|
return this;
|
|
@@ -56172,9 +56141,6 @@ var ReducedType = class extends BaseType {
|
|
|
56172
56141
|
equals(other, considerLocale = false) {
|
|
56173
56142
|
return this === other || other.kind === "reduced" && (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.substitutions, considerLocale);
|
|
56174
56143
|
}
|
|
56175
|
-
getEntity() {
|
|
56176
|
-
return this.entity;
|
|
56177
|
-
}
|
|
56178
56144
|
};
|
|
56179
56145
|
|
|
56180
56146
|
// source/types/StandardTypes.ts
|
|
@@ -56358,15 +56324,15 @@ var StructuredType = class extends BaseType {
|
|
|
56358
56324
|
this.entity = entity;
|
|
56359
56325
|
this.substitutions = substitutions;
|
|
56360
56326
|
}
|
|
56327
|
+
get structuredTypeKind() {
|
|
56328
|
+
return this.entity.structuredTypeKind;
|
|
56329
|
+
}
|
|
56361
56330
|
get isNullType() {
|
|
56362
56331
|
return this.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.nullEntity;
|
|
56363
56332
|
}
|
|
56364
56333
|
get asType() {
|
|
56365
56334
|
return this;
|
|
56366
56335
|
}
|
|
56367
|
-
getSubstitutions() {
|
|
56368
|
-
return this.substitutions;
|
|
56369
|
-
}
|
|
56370
56336
|
getTypeParameters() {
|
|
56371
56337
|
return this.entity.getTypeParameters();
|
|
56372
56338
|
}
|
|
@@ -56393,17 +56359,14 @@ var StructuredType = class extends BaseType {
|
|
|
56393
56359
|
}
|
|
56394
56360
|
return this.analyzer.typeFactory.getStructuredType(this.entity, newSubstitutions);
|
|
56395
56361
|
}
|
|
56396
|
-
getStructuredTypeKind() {
|
|
56397
|
-
return this.entity.getStructuredTypeKind();
|
|
56398
|
-
}
|
|
56399
56362
|
isClass() {
|
|
56400
|
-
return this.entity.
|
|
56363
|
+
return this.entity.structuredTypeKind === 0 /* Class */;
|
|
56401
56364
|
}
|
|
56402
56365
|
isStructure() {
|
|
56403
|
-
return this.entity.
|
|
56366
|
+
return this.entity.structuredTypeKind === 1 /* Structure */;
|
|
56404
56367
|
}
|
|
56405
56368
|
isAspect() {
|
|
56406
|
-
return this.entity.
|
|
56369
|
+
return this.entity.structuredTypeKind === 2 /* Aspect */;
|
|
56407
56370
|
}
|
|
56408
56371
|
markedBasic() {
|
|
56409
56372
|
return this.entity.markedBasic();
|
|
@@ -56412,10 +56375,7 @@ var StructuredType = class extends BaseType {
|
|
|
56412
56375
|
return this.entity.isAbstract();
|
|
56413
56376
|
}
|
|
56414
56377
|
equals(other, considerLocale = false) {
|
|
56415
|
-
return this === other || other.kind === "structured" && (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.
|
|
56416
|
-
}
|
|
56417
|
-
getEntity() {
|
|
56418
|
-
return this.entity;
|
|
56378
|
+
return this === other || other.kind === "structured" && (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.substitutions, considerLocale);
|
|
56419
56379
|
}
|
|
56420
56380
|
getBaseObjectType() {
|
|
56421
56381
|
return this.baseObjectType.getOrInsertWith(() => this.entity.getBaseObjectType().cycleFree?.applySubstitutions(this.substitutions));
|
|
@@ -56432,21 +56392,21 @@ var SubstitutionStubType = class extends BaseType {
|
|
|
56432
56392
|
this.kind = "substitution-stub";
|
|
56433
56393
|
this.index = index;
|
|
56434
56394
|
}
|
|
56395
|
+
get entity() {
|
|
56396
|
+
return void 0;
|
|
56397
|
+
}
|
|
56398
|
+
get substitutions() {
|
|
56399
|
+
return Substitutions.empty();
|
|
56400
|
+
}
|
|
56435
56401
|
get asType() {
|
|
56436
56402
|
return this;
|
|
56437
56403
|
}
|
|
56438
56404
|
equals(other, _considerLocale = false) {
|
|
56439
56405
|
return other.kind === "substitution-stub" && this.index === other.index;
|
|
56440
56406
|
}
|
|
56441
|
-
getSubstitutions() {
|
|
56442
|
-
return Substitutions.empty();
|
|
56443
|
-
}
|
|
56444
56407
|
applySubstitutions(_substitutions) {
|
|
56445
56408
|
return this;
|
|
56446
56409
|
}
|
|
56447
|
-
getEntity() {
|
|
56448
|
-
return void 0;
|
|
56449
|
-
}
|
|
56450
56410
|
};
|
|
56451
56411
|
|
|
56452
56412
|
// source/types/UnionType.ts
|
|
@@ -56457,6 +56417,12 @@ var UnionType = class extends BaseType {
|
|
|
56457
56417
|
this.unaliasedFlattenedTypes_ = new Cached();
|
|
56458
56418
|
this.originalTypes = originalTypes;
|
|
56459
56419
|
}
|
|
56420
|
+
get entity() {
|
|
56421
|
+
return void 0;
|
|
56422
|
+
}
|
|
56423
|
+
get substitutions() {
|
|
56424
|
+
return Substitutions.empty();
|
|
56425
|
+
}
|
|
56460
56426
|
get unaliasedFlattenedTypes() {
|
|
56461
56427
|
return this.unaliasedFlattenedTypes_.getOrInsertWith(() => this.unaliasAndFlattenTypes());
|
|
56462
56428
|
}
|
|
@@ -56470,9 +56436,6 @@ var UnionType = class extends BaseType {
|
|
|
56470
56436
|
(t1, t2) => t1.equals(t2, considerLocale)
|
|
56471
56437
|
);
|
|
56472
56438
|
}
|
|
56473
|
-
getSubstitutions() {
|
|
56474
|
-
return Substitutions.empty();
|
|
56475
|
-
}
|
|
56476
56439
|
applySubstitutions(substitutions) {
|
|
56477
56440
|
if (substitutions.size === 0) {
|
|
56478
56441
|
return this;
|
|
@@ -56489,9 +56452,6 @@ var UnionType = class extends BaseType {
|
|
|
56489
56452
|
}
|
|
56490
56453
|
return this.analyzer.typeFactory.getUnionType(types);
|
|
56491
56454
|
}
|
|
56492
|
-
getEntity() {
|
|
56493
|
-
return void 0;
|
|
56494
|
-
}
|
|
56495
56455
|
unaliasAndFlattenTypes() {
|
|
56496
56456
|
const originalTypes = this.originalTypes;
|
|
56497
56457
|
if (!originalTypes.some((t) => t.kind === "alias")) {
|
|
@@ -56516,21 +56476,21 @@ var UnresolvedType = class extends BaseType {
|
|
|
56516
56476
|
super(analyzer);
|
|
56517
56477
|
this.kind = "unresolved";
|
|
56518
56478
|
}
|
|
56479
|
+
get entity() {
|
|
56480
|
+
return void 0;
|
|
56481
|
+
}
|
|
56482
|
+
get substitutions() {
|
|
56483
|
+
return Substitutions.empty();
|
|
56484
|
+
}
|
|
56519
56485
|
get asType() {
|
|
56520
56486
|
return this;
|
|
56521
56487
|
}
|
|
56522
56488
|
equals(other, _considerLocale = false) {
|
|
56523
56489
|
return other.kind === "unresolved";
|
|
56524
56490
|
}
|
|
56525
|
-
getSubstitutions() {
|
|
56526
|
-
return Substitutions.empty();
|
|
56527
|
-
}
|
|
56528
56491
|
applySubstitutions(_substitutions) {
|
|
56529
56492
|
return this;
|
|
56530
56493
|
}
|
|
56531
|
-
getEntity() {
|
|
56532
|
-
return void 0;
|
|
56533
|
-
}
|
|
56534
56494
|
};
|
|
56535
56495
|
|
|
56536
56496
|
// source/types/VariantType.ts
|
|
@@ -56544,9 +56504,6 @@ var VariantType = class extends BaseType {
|
|
|
56544
56504
|
get asType() {
|
|
56545
56505
|
return this;
|
|
56546
56506
|
}
|
|
56547
|
-
getSubstitutions() {
|
|
56548
|
-
return this.substitutions;
|
|
56549
|
-
}
|
|
56550
56507
|
applySubstitutions(substitutions) {
|
|
56551
56508
|
if (substitutions.size === 0) {
|
|
56552
56509
|
return this;
|
|
@@ -56570,9 +56527,6 @@ var VariantType = class extends BaseType {
|
|
|
56570
56527
|
}
|
|
56571
56528
|
return this.analyzer.typeFactory.getVariantType(this.entity, newSubstitutions);
|
|
56572
56529
|
}
|
|
56573
|
-
getEntity() {
|
|
56574
|
-
return this.entity;
|
|
56575
|
-
}
|
|
56576
56530
|
equals(other, considerLocale = false) {
|
|
56577
56531
|
return this === other || other.kind === "variant" && (considerLocale ? this.entity === other.entity : this.entity.getOriginalEntity() === other.entity.getOriginalEntity()) && this.substitutions.equals(other.substitutions, considerLocale);
|
|
56578
56532
|
}
|
|
@@ -57586,6 +57540,9 @@ var TranslatedPackageStructuredTypeEntity = class {
|
|
|
57586
57540
|
this.translation = translation;
|
|
57587
57541
|
this.name = name;
|
|
57588
57542
|
}
|
|
57543
|
+
get structuredTypeKind() {
|
|
57544
|
+
return this.originalEntity.structuredTypeKind;
|
|
57545
|
+
}
|
|
57589
57546
|
get localizationContext() {
|
|
57590
57547
|
return this.translation.translationPackage.getLocalizationContext();
|
|
57591
57548
|
}
|
|
@@ -57619,9 +57576,6 @@ var TranslatedPackageStructuredTypeEntity = class {
|
|
|
57619
57576
|
isAbstract() {
|
|
57620
57577
|
return this.originalEntity.isAbstract();
|
|
57621
57578
|
}
|
|
57622
|
-
getStructuredTypeKind() {
|
|
57623
|
-
return this.originalEntity.getStructuredTypeKind();
|
|
57624
|
-
}
|
|
57625
57579
|
getArity() {
|
|
57626
57580
|
return this.originalEntity.getArity();
|
|
57627
57581
|
}
|
|
@@ -57656,6 +57610,9 @@ var TranslatedAnonymousStructuredTypeEntity = class {
|
|
|
57656
57610
|
this.originalEntity = originalEntity;
|
|
57657
57611
|
this.translation = translation;
|
|
57658
57612
|
}
|
|
57613
|
+
get structuredTypeKind() {
|
|
57614
|
+
return this.originalEntity.structuredTypeKind;
|
|
57615
|
+
}
|
|
57659
57616
|
get localizationContext() {
|
|
57660
57617
|
return this.translation.translationPackage.getLocalizationContext();
|
|
57661
57618
|
}
|
|
@@ -57693,9 +57650,6 @@ var TranslatedAnonymousStructuredTypeEntity = class {
|
|
|
57693
57650
|
isAbstract() {
|
|
57694
57651
|
return this.originalEntity.isAbstract();
|
|
57695
57652
|
}
|
|
57696
|
-
getStructuredTypeKind() {
|
|
57697
|
-
return this.originalEntity.getStructuredTypeKind();
|
|
57698
|
-
}
|
|
57699
57653
|
getArity() {
|
|
57700
57654
|
return this.originalEntity.getArity();
|
|
57701
57655
|
}
|
|
@@ -57731,6 +57685,9 @@ var TranslatedLocalStructuredTypeEntity = class {
|
|
|
57731
57685
|
this.translation = translation;
|
|
57732
57686
|
this.name = name;
|
|
57733
57687
|
}
|
|
57688
|
+
get structuredTypeKind() {
|
|
57689
|
+
return this.originalEntity.structuredTypeKind;
|
|
57690
|
+
}
|
|
57734
57691
|
get localizationContext() {
|
|
57735
57692
|
return this.translation.translationPackage.getLocalizationContext();
|
|
57736
57693
|
}
|
|
@@ -57771,9 +57728,6 @@ var TranslatedLocalStructuredTypeEntity = class {
|
|
|
57771
57728
|
isAbstract() {
|
|
57772
57729
|
return this.originalEntity.isAbstract();
|
|
57773
57730
|
}
|
|
57774
|
-
getStructuredTypeKind() {
|
|
57775
|
-
return this.originalEntity.getStructuredTypeKind();
|
|
57776
|
-
}
|
|
57777
57731
|
getArity() {
|
|
57778
57732
|
return this.originalEntity.getArity();
|
|
57779
57733
|
}
|
|
@@ -60700,9 +60654,8 @@ var AccessibilityCheck = class {
|
|
|
60700
60654
|
}
|
|
60701
60655
|
let result = this.isTypeDerivedFromOrEquals(context.typeOrExtensionEntity, hiding.baseTypeEntity);
|
|
60702
60656
|
if (result && !ignoreReceiverType && !entity.isStatic()) {
|
|
60703
|
-
|
|
60704
|
-
|
|
60705
|
-
receiverTypeEntity,
|
|
60657
|
+
result = receiverType?.entity !== void 0 && this.isTypeDerivedFromOrEquals(
|
|
60658
|
+
receiverType.entity,
|
|
60706
60659
|
context.typeOrExtensionEntity
|
|
60707
60660
|
);
|
|
60708
60661
|
}
|
|
@@ -60721,13 +60674,13 @@ var AccessibilityCheck = class {
|
|
|
60721
60674
|
}
|
|
60722
60675
|
switch (derived.typeEntityKind) {
|
|
60723
60676
|
case 1 /* Structured */:
|
|
60724
|
-
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.
|
|
60677
|
+
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.entity, base) || derived.getBaseAspectTypes().cycleFree.some((t) => this.isTypeDerivedFromOrEquals(t.unalias().entity, base));
|
|
60725
60678
|
case 3 /* Variant */:
|
|
60726
|
-
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.
|
|
60679
|
+
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.entity, base);
|
|
60727
60680
|
case 0 /* Function */:
|
|
60728
|
-
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.
|
|
60681
|
+
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.entity, base);
|
|
60729
60682
|
case 5 /* Reduced */:
|
|
60730
|
-
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.
|
|
60683
|
+
return this.isTypeDerivedFromOrEquals(derived.getBaseObjectType().cycleFree?.unalias()?.entity, base) || derived.getBaseAspectTypes().cycleFree.some((t) => this.isTypeDerivedFromOrEquals(t.unalias().entity, base));
|
|
60731
60684
|
case 2 /* Parameter */:
|
|
60732
60685
|
case 4 /* Alias */:
|
|
60733
60686
|
return false;
|
|
@@ -60985,17 +60938,17 @@ var TypeMemberLookupBase = class {
|
|
|
60985
60938
|
tryGetTypeLocale(type) {
|
|
60986
60939
|
switch (type.kind) {
|
|
60987
60940
|
case "function":
|
|
60988
|
-
return type.
|
|
60941
|
+
return type.entity.getLocale();
|
|
60989
60942
|
case "structured":
|
|
60990
|
-
return type.
|
|
60943
|
+
return type.entity.getLocale();
|
|
60991
60944
|
case "variant":
|
|
60992
|
-
return type.
|
|
60945
|
+
return type.entity.getLocale();
|
|
60993
60946
|
case "alias":
|
|
60994
|
-
return type.
|
|
60947
|
+
return type.entity.getLocale();
|
|
60995
60948
|
case "reduced":
|
|
60996
|
-
return type.
|
|
60949
|
+
return type.entity.getLocale();
|
|
60997
60950
|
case "parameter":
|
|
60998
|
-
return type.
|
|
60951
|
+
return type.entity.getLocale();
|
|
60999
60952
|
case "unresolved":
|
|
61000
60953
|
case "substitution-stub":
|
|
61001
60954
|
return void 0;
|
|
@@ -61060,7 +61013,7 @@ var TypeMemberLookupBase = class {
|
|
|
61060
61013
|
const extendedTypeEntity = entity.getExtendedTypeEntity();
|
|
61061
61014
|
if (extendedTypeEntity !== void 0) {
|
|
61062
61015
|
extendedType = this.analyzer.instantiateTypeByIdentitySubstitution(extendedTypeEntity);
|
|
61063
|
-
substitutions = extendedType.
|
|
61016
|
+
substitutions = extendedType.substitutions;
|
|
61064
61017
|
} else {
|
|
61065
61018
|
extendedType = void 0;
|
|
61066
61019
|
substitutions = Substitutions.empty();
|
|
@@ -61106,25 +61059,25 @@ var TypeMemberLookupBase = class {
|
|
|
61106
61059
|
}
|
|
61107
61060
|
getAllMembersOfStructuredType(type, options, state) {
|
|
61108
61061
|
const result = this.getAllMembersOfRegularTypeOrExtension(
|
|
61109
|
-
type.
|
|
61110
|
-
type.
|
|
61062
|
+
type.entity,
|
|
61063
|
+
type.substitutions,
|
|
61111
61064
|
type.getBaseObjectType(),
|
|
61112
61065
|
type.getBaseAspectTypes(),
|
|
61113
61066
|
options,
|
|
61114
61067
|
state
|
|
61115
61068
|
);
|
|
61116
|
-
if (type.
|
|
61069
|
+
if (type.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object) {
|
|
61117
61070
|
state.searchedInStandardObjectType = true;
|
|
61118
61071
|
}
|
|
61119
|
-
if (type.
|
|
61072
|
+
if (type.structuredTypeKind === 2 /* Aspect */) {
|
|
61120
61073
|
state.searchedInAspect = true;
|
|
61121
61074
|
}
|
|
61122
61075
|
return result;
|
|
61123
61076
|
}
|
|
61124
61077
|
getAllMembersOfVariantType(type, options, state) {
|
|
61125
61078
|
return this.getAllMembersOfRegularTypeOrExtension(
|
|
61126
|
-
type.
|
|
61127
|
-
type.
|
|
61079
|
+
type.entity,
|
|
61080
|
+
type.substitutions,
|
|
61128
61081
|
type.getBaseType(),
|
|
61129
61082
|
void 0,
|
|
61130
61083
|
options,
|
|
@@ -61133,8 +61086,8 @@ var TypeMemberLookupBase = class {
|
|
|
61133
61086
|
}
|
|
61134
61087
|
getAllMembersOfFunctionType(type, options, state) {
|
|
61135
61088
|
return this.getAllMembersOfRegularTypeOrExtension(
|
|
61136
|
-
type.
|
|
61137
|
-
type.
|
|
61089
|
+
type.entity,
|
|
61090
|
+
type.substitutions,
|
|
61138
61091
|
type.getBaseType(),
|
|
61139
61092
|
void 0,
|
|
61140
61093
|
options,
|
|
@@ -61142,7 +61095,7 @@ var TypeMemberLookupBase = class {
|
|
|
61142
61095
|
);
|
|
61143
61096
|
}
|
|
61144
61097
|
getAllMembersOfAliasType(type, options, state) {
|
|
61145
|
-
const result = this.getOwnMembersMatchingHiding(type.
|
|
61098
|
+
const result = this.getOwnMembersMatchingHiding(type.entity, type.substitutions, options);
|
|
61146
61099
|
const baseAndExtensionMembers = new Array();
|
|
61147
61100
|
if ((options & 16 /* NoBaseTypeMembers */) === 0) {
|
|
61148
61101
|
const aliasedType = type.getAliasedType();
|
|
@@ -61151,8 +61104,8 @@ var TypeMemberLookupBase = class {
|
|
|
61151
61104
|
}
|
|
61152
61105
|
if (this.context?.typeExtensionLookup !== void 0 && (options & 4 /* NoTypeExtensionMembers */) === 0) {
|
|
61153
61106
|
const extensionMembers = this.getMembersOfExtensionsMatchingHiding(
|
|
61154
|
-
type.
|
|
61155
|
-
type.
|
|
61107
|
+
type.entity,
|
|
61108
|
+
type.substitutions,
|
|
61156
61109
|
options,
|
|
61157
61110
|
this.context.typeExtensionLookup
|
|
61158
61111
|
);
|
|
@@ -61163,8 +61116,8 @@ var TypeMemberLookupBase = class {
|
|
|
61163
61116
|
}
|
|
61164
61117
|
getAllMembersOfReducedType(type, options, state) {
|
|
61165
61118
|
return this.getAllMembersOfRegularTypeOrExtension(
|
|
61166
|
-
type.
|
|
61167
|
-
type.
|
|
61119
|
+
type.entity,
|
|
61120
|
+
type.substitutions,
|
|
61168
61121
|
type.getBaseObjectType(),
|
|
61169
61122
|
type.getBaseAspectTypes(),
|
|
61170
61123
|
options,
|
|
@@ -61295,7 +61248,7 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61295
61248
|
const extendedTypeEntity = entity.getExtendedTypeEntity();
|
|
61296
61249
|
if (extendedTypeEntity !== void 0) {
|
|
61297
61250
|
extendedType = this.analyzer.instantiateTypeByIdentitySubstitution(extendedTypeEntity);
|
|
61298
|
-
substitutions = extendedType.
|
|
61251
|
+
substitutions = extendedType.substitutions;
|
|
61299
61252
|
} else {
|
|
61300
61253
|
extendedType = void 0;
|
|
61301
61254
|
substitutions = Substitutions.empty();
|
|
@@ -61343,17 +61296,17 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61343
61296
|
getMembersOfStructuredTypeByKey(key, type, options, state) {
|
|
61344
61297
|
const result = this.getMembersOfRegularTypeOrExtensionByKey(
|
|
61345
61298
|
key,
|
|
61346
|
-
type.
|
|
61347
|
-
type.
|
|
61299
|
+
type.entity,
|
|
61300
|
+
type.substitutions,
|
|
61348
61301
|
type.getBaseObjectType(),
|
|
61349
61302
|
type.getBaseAspectTypes(),
|
|
61350
61303
|
options,
|
|
61351
61304
|
state
|
|
61352
61305
|
);
|
|
61353
|
-
if (type.
|
|
61306
|
+
if (type.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object) {
|
|
61354
61307
|
state.searchedInStandardObjectType = true;
|
|
61355
61308
|
}
|
|
61356
|
-
if (type.
|
|
61309
|
+
if (type.structuredTypeKind === 2 /* Aspect */) {
|
|
61357
61310
|
state.searchedInAspect = true;
|
|
61358
61311
|
}
|
|
61359
61312
|
return result;
|
|
@@ -61361,8 +61314,8 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61361
61314
|
getMembersOfVariantTypeByKey(key, type, options, state) {
|
|
61362
61315
|
return this.getMembersOfRegularTypeOrExtensionByKey(
|
|
61363
61316
|
key,
|
|
61364
|
-
type.
|
|
61365
|
-
type.
|
|
61317
|
+
type.entity,
|
|
61318
|
+
type.substitutions,
|
|
61366
61319
|
type.getBaseType(),
|
|
61367
61320
|
void 0,
|
|
61368
61321
|
options,
|
|
@@ -61372,8 +61325,8 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61372
61325
|
getMembersOfFunctionTypeByKey(key, type, options, state) {
|
|
61373
61326
|
return this.getMembersOfRegularTypeOrExtensionByKey(
|
|
61374
61327
|
key,
|
|
61375
|
-
type.
|
|
61376
|
-
type.
|
|
61328
|
+
type.entity,
|
|
61329
|
+
type.substitutions,
|
|
61377
61330
|
type.getBaseType(),
|
|
61378
61331
|
void 0,
|
|
61379
61332
|
options,
|
|
@@ -61381,7 +61334,7 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61381
61334
|
);
|
|
61382
61335
|
}
|
|
61383
61336
|
getMembersOfAliasTypeByKey(key, type, options, state) {
|
|
61384
|
-
const result = this.getOwnMembersByKeyMatchingHiding(key, type.
|
|
61337
|
+
const result = this.getOwnMembersByKeyMatchingHiding(key, type.entity, type.substitutions, options);
|
|
61385
61338
|
const baseAndExtensionMembers = new Array();
|
|
61386
61339
|
if ((options & 16 /* NoBaseTypeMembers */) === 0) {
|
|
61387
61340
|
const aliasedType = type.getAliasedType();
|
|
@@ -61391,8 +61344,8 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61391
61344
|
if (this.context?.typeExtensionLookup !== void 0 && (options & 4 /* NoTypeExtensionMembers */) === 0) {
|
|
61392
61345
|
const extensionMembers = this.getMembersOfExtensionsByKeyMatchingHiding(
|
|
61393
61346
|
key,
|
|
61394
|
-
type.
|
|
61395
|
-
type.
|
|
61347
|
+
type.entity,
|
|
61348
|
+
type.substitutions,
|
|
61396
61349
|
options,
|
|
61397
61350
|
this.context.typeExtensionLookup
|
|
61398
61351
|
);
|
|
@@ -61404,8 +61357,8 @@ var TypeMemberLookupByKeyBase = class extends TypeMemberLookupBase {
|
|
|
61404
61357
|
getMembersOfReducedTypeByKey(key, type, options, state) {
|
|
61405
61358
|
return this.getMembersOfRegularTypeOrExtensionByKey(
|
|
61406
61359
|
key,
|
|
61407
|
-
type.
|
|
61408
|
-
type.
|
|
61360
|
+
type.entity,
|
|
61361
|
+
type.substitutions,
|
|
61409
61362
|
type.getBaseObjectType(),
|
|
61410
61363
|
type.getBaseAspectTypes(),
|
|
61411
61364
|
options,
|
|
@@ -61618,19 +61571,19 @@ var ConstructorLookup = class {
|
|
|
61618
61571
|
}
|
|
61619
61572
|
}
|
|
61620
61573
|
getConstructorsOfStructuredType(type, options) {
|
|
61621
|
-
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61574
|
+
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.entity, type, options);
|
|
61622
61575
|
}
|
|
61623
61576
|
getConstructorsOfVariantType(type, options) {
|
|
61624
|
-
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61577
|
+
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.entity, type, options);
|
|
61625
61578
|
}
|
|
61626
61579
|
getConstructorsOfFunctionType(type, options) {
|
|
61627
|
-
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61580
|
+
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.entity, type, options);
|
|
61628
61581
|
}
|
|
61629
61582
|
getConstructorsOfAliasType(type, options) {
|
|
61630
|
-
let result = this.getOwnConstructors(type.
|
|
61583
|
+
let result = this.getOwnConstructors(type.entity, type, options);
|
|
61631
61584
|
if (this.context?.typeExtensionLookup !== void 0 && (options & 4 /* NoTypeExtensionMembers */) === 0) {
|
|
61632
61585
|
const extensionConstructors = this.getExtensionConstructors(
|
|
61633
|
-
type.
|
|
61586
|
+
type.entity,
|
|
61634
61587
|
type,
|
|
61635
61588
|
options,
|
|
61636
61589
|
this.context.typeExtensionLookup
|
|
@@ -61640,11 +61593,11 @@ var ConstructorLookup = class {
|
|
|
61640
61593
|
if ((options & 16 /* NoBaseTypeMembers */) === 0) {
|
|
61641
61594
|
let aliasedType = type.getAliasedType();
|
|
61642
61595
|
while (aliasedType.kind === "alias") {
|
|
61643
|
-
const constructors2 = this.getOwnConstructors(aliasedType.
|
|
61596
|
+
const constructors2 = this.getOwnConstructors(aliasedType.entity, aliasedType, options);
|
|
61644
61597
|
result = this.mergeConstructors(result, constructors2);
|
|
61645
61598
|
if (this.context?.typeExtensionLookup !== void 0 && (options & 4 /* NoTypeExtensionMembers */) === 0) {
|
|
61646
61599
|
const extensionConstructors = this.getExtensionConstructors(
|
|
61647
|
-
aliasedType.
|
|
61600
|
+
aliasedType.entity,
|
|
61648
61601
|
aliasedType,
|
|
61649
61602
|
options,
|
|
61650
61603
|
this.context.typeExtensionLookup
|
|
@@ -61659,7 +61612,7 @@ var ConstructorLookup = class {
|
|
|
61659
61612
|
return result;
|
|
61660
61613
|
}
|
|
61661
61614
|
getConstructorsOfReducedType(type, options) {
|
|
61662
|
-
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61615
|
+
return this.getConstructorsOfTypeWithOwnMembersOrExtension(type.entity, type, options);
|
|
61663
61616
|
}
|
|
61664
61617
|
getConstructorsOfTypeWithOwnMembersOrExtension(entity, type, options) {
|
|
61665
61618
|
let result = this.getOwnConstructors(entity, type, options);
|
|
@@ -61675,7 +61628,7 @@ var ConstructorLookup = class {
|
|
|
61675
61628
|
return result;
|
|
61676
61629
|
}
|
|
61677
61630
|
getOwnConstructors(entity, type, options) {
|
|
61678
|
-
let result = entity.getMembers().getConstructors().map((c) => new Method(this.analyzer, c, type.
|
|
61631
|
+
let result = entity.getMembers().getConstructors().map((c) => new Method(this.analyzer, c, type.substitutions));
|
|
61679
61632
|
if (this.context !== void 0 && this.context.affectsAccessibility()) {
|
|
61680
61633
|
const ignoreReceiverType = (options & 8 /* CheckAccessibilityIgnoringReceiverType */) !== 0;
|
|
61681
61634
|
result = result.filter((m) => AccessibilityCheck.isTypeMemberAccessible(
|
|
@@ -61688,7 +61641,7 @@ var ConstructorLookup = class {
|
|
|
61688
61641
|
return result;
|
|
61689
61642
|
}
|
|
61690
61643
|
getExtensionConstructors(entity, type, options, typeExtensionLookup) {
|
|
61691
|
-
let result = typeExtensionLookup.getTypeExtensionsByType(entity).flatMap((e) => e.getMembers().getConstructors().map((c) => new Method(this.analyzer, c, type.
|
|
61644
|
+
let result = typeExtensionLookup.getTypeExtensionsByType(entity).flatMap((e) => e.getMembers().getConstructors().map((c) => new Method(this.analyzer, c, type.substitutions)));
|
|
61692
61645
|
if (this.context !== void 0 && this.context.affectsAccessibility()) {
|
|
61693
61646
|
const ignoreReceiverType = (options & 8 /* CheckAccessibilityIgnoringReceiverType */) !== 0;
|
|
61694
61647
|
result = result.filter((m) => AccessibilityCheck.isTypeMemberAccessible(
|
|
@@ -61768,19 +61721,19 @@ var DestructorLookup = class {
|
|
|
61768
61721
|
}
|
|
61769
61722
|
}
|
|
61770
61723
|
getDestructorsOfStructuredType(type, context, options) {
|
|
61771
|
-
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61724
|
+
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.entity, type, context, options);
|
|
61772
61725
|
}
|
|
61773
61726
|
getDestructorsOfVariantType(type, context, options) {
|
|
61774
|
-
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61727
|
+
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.entity, type, context, options);
|
|
61775
61728
|
}
|
|
61776
61729
|
getDestructorsOfFunctionType(type, context, options) {
|
|
61777
|
-
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61730
|
+
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.entity, type, context, options);
|
|
61778
61731
|
}
|
|
61779
61732
|
getDestructorsOfAliasType(type, context, options) {
|
|
61780
|
-
let result = this.getOwnDestructors(type.
|
|
61733
|
+
let result = this.getOwnDestructors(type.entity, type, context, options);
|
|
61781
61734
|
if (context?.typeExtensionLookup !== void 0 && (options & 4 /* NoTypeExtensionMembers */) === 0) {
|
|
61782
61735
|
const extensionDestructors = this.getExtensionDestructors(
|
|
61783
|
-
type.
|
|
61736
|
+
type.entity,
|
|
61784
61737
|
type,
|
|
61785
61738
|
context,
|
|
61786
61739
|
options,
|
|
@@ -61794,7 +61747,7 @@ var DestructorLookup = class {
|
|
|
61794
61747
|
return result;
|
|
61795
61748
|
}
|
|
61796
61749
|
getDestructorsOfReducedType(type, context, options) {
|
|
61797
|
-
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.
|
|
61750
|
+
return this.getDestructorsOfTypeWithOwnMembersOrExtension(type.entity, type, context, options);
|
|
61798
61751
|
}
|
|
61799
61752
|
getDestructorsOfTypeWithOwnMembersOrExtension(entity, type, context, options) {
|
|
61800
61753
|
let result = this.getOwnDestructors(entity, type, context, options);
|
|
@@ -61811,7 +61764,7 @@ var DestructorLookup = class {
|
|
|
61811
61764
|
return result;
|
|
61812
61765
|
}
|
|
61813
61766
|
getOwnDestructors(entity, type, context, options) {
|
|
61814
|
-
let result = entity.getMembers().getDestructors().map((c) => new Method(this.analyzer, c, type.
|
|
61767
|
+
let result = entity.getMembers().getDestructors().map((c) => new Method(this.analyzer, c, type.substitutions));
|
|
61815
61768
|
if (context !== void 0 && context.affectsAccessibility()) {
|
|
61816
61769
|
const ignoreReceiverType = (options & 8 /* CheckAccessibilityIgnoringReceiverType */) !== 0;
|
|
61817
61770
|
result = result.filter((m) => AccessibilityCheck.isTypeMemberAccessible(
|
|
@@ -61824,7 +61777,7 @@ var DestructorLookup = class {
|
|
|
61824
61777
|
return result;
|
|
61825
61778
|
}
|
|
61826
61779
|
getExtensionDestructors(entity, type, context, options, typeExtensionLookup) {
|
|
61827
|
-
let result = typeExtensionLookup.getTypeExtensionsByType(entity).flatMap((e) => e.getMembers().getDestructors().map((c) => new Method(this.analyzer, c, type.
|
|
61780
|
+
let result = typeExtensionLookup.getTypeExtensionsByType(entity).flatMap((e) => e.getMembers().getDestructors().map((c) => new Method(this.analyzer, c, type.substitutions)));
|
|
61828
61781
|
if (context !== void 0 && context.affectsAccessibility()) {
|
|
61829
61782
|
const ignoreReceiverType = (options & 8 /* CheckAccessibilityIgnoringReceiverType */) !== 0;
|
|
61830
61783
|
result = result.filter((m) => AccessibilityCheck.isTypeMemberAccessible(
|
|
@@ -62318,7 +62271,7 @@ var TsPropertyEntity = class extends FieldEntityWithImplicitAccessors {
|
|
|
62318
62271
|
}
|
|
62319
62272
|
markedAbstract() {
|
|
62320
62273
|
const declaration = this.getDeclaration();
|
|
62321
|
-
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.
|
|
62274
|
+
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.structuredTypeKind === 2 /* Aspect */;
|
|
62322
62275
|
}
|
|
62323
62276
|
isPreservedReducedTypeMember() {
|
|
62324
62277
|
return void 0;
|
|
@@ -62451,7 +62404,7 @@ var TsAccessorEntity = class extends BaseFieldEntity {
|
|
|
62451
62404
|
}
|
|
62452
62405
|
markedAbstract() {
|
|
62453
62406
|
const declaration = this.getGetAccessorDeclaration();
|
|
62454
|
-
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.
|
|
62407
|
+
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.structuredTypeKind === 2 /* Aspect */;
|
|
62455
62408
|
}
|
|
62456
62409
|
isPreservedReducedTypeMember() {
|
|
62457
62410
|
return void 0;
|
|
@@ -62713,7 +62666,7 @@ var TsMethodEntity = class extends BaseOrdinaryMethodEntity {
|
|
|
62713
62666
|
return (ts2.getCombinedModifierFlags(this.declaration) & ts2.ModifierFlags.Override) !== 0;
|
|
62714
62667
|
}
|
|
62715
62668
|
markedAbstract() {
|
|
62716
|
-
return (ts2.getCombinedModifierFlags(this.declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.
|
|
62669
|
+
return (ts2.getCombinedModifierFlags(this.declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.structuredTypeKind === 2 /* Aspect */;
|
|
62717
62670
|
}
|
|
62718
62671
|
isAsync() {
|
|
62719
62672
|
return this.tsctx.isSignatureAsync(this.declaration);
|
|
@@ -62813,7 +62766,7 @@ var TsIteratorFunctionEntity = class extends BaseOrdinaryMethodEntity {
|
|
|
62813
62766
|
}
|
|
62814
62767
|
markedAbstract() {
|
|
62815
62768
|
const declaration = this.getFirstDeclaration();
|
|
62816
|
-
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.
|
|
62769
|
+
return declaration !== void 0 && (ts2.getCombinedModifierFlags(declaration) & ts2.ModifierFlags.Abstract) !== 0 || this.containingType.typeEntityKind === 1 /* Structured */ && this.containingType.structuredTypeKind === 2 /* Aspect */;
|
|
62817
62770
|
}
|
|
62818
62771
|
isAsync() {
|
|
62819
62772
|
return false;
|
|
@@ -68906,8 +68859,7 @@ var PackageReducedTypeDeclarationEntity = class {
|
|
|
68906
68859
|
const baseType = this.analyzer.type.ofTypeSpecifier(baseTypeSpecifier);
|
|
68907
68860
|
const unaliasedBaseType = baseType.unalias();
|
|
68908
68861
|
if (unaliasedBaseType.kind === "structured") {
|
|
68909
|
-
|
|
68910
|
-
switch (structuredTypeKind) {
|
|
68862
|
+
switch (unaliasedBaseType.structuredTypeKind) {
|
|
68911
68863
|
case 0 /* Class */: {
|
|
68912
68864
|
if (declaredBaseObjectType !== void 0) {
|
|
68913
68865
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
@@ -68948,7 +68900,7 @@ var PackageReducedTypeDeclarationEntity = class {
|
|
|
68948
68900
|
break;
|
|
68949
68901
|
}
|
|
68950
68902
|
default:
|
|
68951
|
-
Debug.never(structuredTypeKind);
|
|
68903
|
+
Debug.never(unaliasedBaseType.structuredTypeKind);
|
|
68952
68904
|
}
|
|
68953
68905
|
} else {
|
|
68954
68906
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
@@ -69289,6 +69241,9 @@ var PackageStructuredTypeDeclarationEntity = class {
|
|
|
69289
69241
|
this.node = node;
|
|
69290
69242
|
this.data = new SourcePackageStructuredTypeDeclarationData(analyzer, node, this);
|
|
69291
69243
|
}
|
|
69244
|
+
get structuredTypeKind() {
|
|
69245
|
+
return this.data.structuredTypeKind;
|
|
69246
|
+
}
|
|
69292
69247
|
getNaming() {
|
|
69293
69248
|
return this.data.getNaming();
|
|
69294
69249
|
}
|
|
@@ -69313,9 +69268,6 @@ var PackageStructuredTypeDeclarationEntity = class {
|
|
|
69313
69268
|
isAbstract() {
|
|
69314
69269
|
return this.data.isAbstract();
|
|
69315
69270
|
}
|
|
69316
|
-
getStructuredTypeKind() {
|
|
69317
|
-
return this.data.getStructuredTypeKind();
|
|
69318
|
-
}
|
|
69319
69271
|
getArity() {
|
|
69320
69272
|
return this.data.getArity();
|
|
69321
69273
|
}
|
|
@@ -69358,6 +69310,9 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
|
69358
69310
|
this.node = node;
|
|
69359
69311
|
this.data = new SourceAnonymousStructuredTypeDeclarationData(analyzer, node, this);
|
|
69360
69312
|
}
|
|
69313
|
+
get structuredTypeKind() {
|
|
69314
|
+
return this.data.structuredTypeKind;
|
|
69315
|
+
}
|
|
69361
69316
|
getNaming() {
|
|
69362
69317
|
return this.data.getNaming();
|
|
69363
69318
|
}
|
|
@@ -69379,9 +69334,6 @@ var AnonymousStructuredTypeDeclarationEntity = class {
|
|
|
69379
69334
|
isAbstract() {
|
|
69380
69335
|
return false;
|
|
69381
69336
|
}
|
|
69382
|
-
getStructuredTypeKind() {
|
|
69383
|
-
return this.data.getStructuredTypeKind();
|
|
69384
|
-
}
|
|
69385
69337
|
getBaseObjectType() {
|
|
69386
69338
|
return this.data.getBaseObjectType();
|
|
69387
69339
|
}
|
|
@@ -69429,7 +69381,7 @@ var SourceStructuredTypeDeclarationData = class {
|
|
|
69429
69381
|
return this.members.getOrInsertWith(() => {
|
|
69430
69382
|
const members = this.analyzer.getDeclaredTypeMemberEntities(this.memberBlock);
|
|
69431
69383
|
const isInterfacePackageMember = this.entity.getContainingPackage().getInterfacePackageInfo() !== void 0;
|
|
69432
|
-
if (!(isInterfacePackageMember || this.
|
|
69384
|
+
if (!(isInterfacePackageMember || this.structuredTypeKind === 2 /* Aspect */)) {
|
|
69433
69385
|
if (members.find((m) => TypeMemberEntity.isConstructor(m)) === void 0) {
|
|
69434
69386
|
const fields = members.filter((m) => m.kind === 0 /* Variable */);
|
|
69435
69387
|
const defaultConstructors = this.analyzer.createDefaultConstructors(this.entity, fields);
|
|
@@ -69471,18 +69423,18 @@ var SourceStructuredTypeDeclarationData = class {
|
|
|
69471
69423
|
const baseType = this.analyzer.type.ofTypeSpecifier(baseTypeSpecifier);
|
|
69472
69424
|
const unaliasedBaseType = baseType.unalias();
|
|
69473
69425
|
if (unaliasedBaseType.kind === "structured") {
|
|
69474
|
-
if (unaliasedBaseType.
|
|
69426
|
+
if (unaliasedBaseType.structuredTypeKind === 0 /* Class */) {
|
|
69475
69427
|
if (declaredBaseObjectType !== void 0) {
|
|
69476
69428
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
69477
69429
|
2131 /* TypeCannotHaveMultipleBaseObjectTypes */,
|
|
69478
69430
|
baseTypeSpecifier
|
|
69479
69431
|
));
|
|
69480
|
-
} else if (this.entity.
|
|
69432
|
+
} else if (this.entity.structuredTypeKind === 1 /* Structure */) {
|
|
69481
69433
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
69482
69434
|
2136 /* StructureCanHaveOnlyAspectsAsBaseTypes */,
|
|
69483
69435
|
baseTypeSpecifier
|
|
69484
69436
|
));
|
|
69485
|
-
} else if (this.entity.
|
|
69437
|
+
} else if (this.entity.structuredTypeKind === 2 /* Aspect */) {
|
|
69486
69438
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
69487
69439
|
2137 /* AspectTypeCanHaveOnlyAspectsAsBaseTypes */,
|
|
69488
69440
|
baseTypeSpecifier
|
|
@@ -69495,12 +69447,12 @@ var SourceStructuredTypeDeclarationData = class {
|
|
|
69495
69447
|
} else {
|
|
69496
69448
|
declaredBaseObjectType = baseType;
|
|
69497
69449
|
}
|
|
69498
|
-
} else if (unaliasedBaseType.
|
|
69450
|
+
} else if (unaliasedBaseType.structuredTypeKind === 1 /* Structure */) {
|
|
69499
69451
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
69500
69452
|
2133 /* StructureCannotBeUsedAsBaseType */,
|
|
69501
69453
|
baseTypeSpecifier
|
|
69502
69454
|
));
|
|
69503
|
-
} else if (unaliasedBaseType.
|
|
69455
|
+
} else if (unaliasedBaseType.structuredTypeKind === 2 /* Aspect */) {
|
|
69504
69456
|
if (declaredBaseAspectTypes.some((t) => t.unalias().equals(unaliasedBaseType))) {
|
|
69505
69457
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
69506
69458
|
2134 /* ThisTypeIsAlreadyListedInBaseTypeList */,
|
|
@@ -69533,6 +69485,18 @@ var SourcePackageStructuredTypeDeclarationData = class extends SourceStructuredT
|
|
|
69533
69485
|
this.entity = entity;
|
|
69534
69486
|
this.name = analyzer.createNameFromIdentifier(node.name);
|
|
69535
69487
|
}
|
|
69488
|
+
get structuredTypeKind() {
|
|
69489
|
+
switch (this.node.kind) {
|
|
69490
|
+
case 27 /* PackageClassDeclaration */:
|
|
69491
|
+
return 0 /* Class */;
|
|
69492
|
+
case 28 /* PackageStructureDeclaration */:
|
|
69493
|
+
return 1 /* Structure */;
|
|
69494
|
+
case 29 /* PackageAspectDeclaration */:
|
|
69495
|
+
return 2 /* Aspect */;
|
|
69496
|
+
default:
|
|
69497
|
+
Debug.never(this.node);
|
|
69498
|
+
}
|
|
69499
|
+
}
|
|
69536
69500
|
get memberBlock() {
|
|
69537
69501
|
return this.node.memberBlock;
|
|
69538
69502
|
}
|
|
@@ -69575,20 +69539,11 @@ var SourcePackageStructuredTypeDeclarationData = class extends SourceStructuredT
|
|
|
69575
69539
|
getSubstitutionApplicationMode() {
|
|
69576
69540
|
return 0 /* SubstituteOwnSubstitutions */;
|
|
69577
69541
|
}
|
|
69578
|
-
getStructuredTypeKind() {
|
|
69579
|
-
switch (this.node.kind) {
|
|
69580
|
-
case 27 /* PackageClassDeclaration */:
|
|
69581
|
-
return 0 /* Class */;
|
|
69582
|
-
case 28 /* PackageStructureDeclaration */:
|
|
69583
|
-
return 1 /* Structure */;
|
|
69584
|
-
case 29 /* PackageAspectDeclaration */:
|
|
69585
|
-
return 2 /* Aspect */;
|
|
69586
|
-
default:
|
|
69587
|
-
Debug.never(this.node);
|
|
69588
|
-
}
|
|
69589
|
-
}
|
|
69590
69542
|
};
|
|
69591
69543
|
var SourceAnonymousStructuredTypeDeclarationData = class extends SourceStructuredTypeDeclarationData {
|
|
69544
|
+
get structuredTypeKind() {
|
|
69545
|
+
return 0 /* Class */;
|
|
69546
|
+
}
|
|
69592
69547
|
get memberBlock() {
|
|
69593
69548
|
return this.node.memberBlock;
|
|
69594
69549
|
}
|
|
@@ -69615,9 +69570,6 @@ var SourceAnonymousStructuredTypeDeclarationData = class extends SourceStructure
|
|
|
69615
69570
|
getSubstitutionApplicationMode() {
|
|
69616
69571
|
return 1 /* SubstituteOwnSubstitutionsAndMerge */;
|
|
69617
69572
|
}
|
|
69618
|
-
getStructuredTypeKind() {
|
|
69619
|
-
return 0 /* Class */;
|
|
69620
|
-
}
|
|
69621
69573
|
};
|
|
69622
69574
|
|
|
69623
69575
|
// source/analysis/a/TextIdentity.ts
|
|
@@ -70547,6 +70499,9 @@ var TsGlobalClassOrInterfaceEntity = class {
|
|
|
70547
70499
|
this.hiding = new Cached();
|
|
70548
70500
|
this.name = this.tsctx.createName(this.symbol.name, "type");
|
|
70549
70501
|
}
|
|
70502
|
+
get structuredTypeKind() {
|
|
70503
|
+
return this.isClassOrInterfaceAndVariableMerge() ? 0 /* Class */ : 2 /* Aspect */;
|
|
70504
|
+
}
|
|
70550
70505
|
getNaming() {
|
|
70551
70506
|
return new EntityNaming_named(this.getName());
|
|
70552
70507
|
}
|
|
@@ -70602,15 +70557,12 @@ var TsGlobalClassOrInterfaceEntity = class {
|
|
|
70602
70557
|
return { kind: 2 /* TypeScript */ };
|
|
70603
70558
|
}
|
|
70604
70559
|
markedBasic() {
|
|
70605
|
-
return this.
|
|
70560
|
+
return this.structuredTypeKind === 0 /* Class */ && !this.isAbstract();
|
|
70606
70561
|
}
|
|
70607
70562
|
isAbstract() {
|
|
70608
70563
|
const decl = this.getDeclaration();
|
|
70609
70564
|
return decl !== void 0 && (ts4.getCombinedModifierFlags(decl) & ts4.ModifierFlags.Abstract) !== 0;
|
|
70610
70565
|
}
|
|
70611
|
-
getStructuredTypeKind() {
|
|
70612
|
-
return this.isClassOrInterfaceAndVariableMerge() ? 0 /* Class */ : 2 /* Aspect */;
|
|
70613
|
-
}
|
|
70614
70566
|
getArity() {
|
|
70615
70567
|
return this.getTypeParameters().length;
|
|
70616
70568
|
}
|
|
@@ -70621,7 +70573,7 @@ var TsGlobalClassOrInterfaceEntity = class {
|
|
|
70621
70573
|
const symbolType = this.tsctx.tsChecker.getDeclaredTypeOfSymbol(this.symbol);
|
|
70622
70574
|
if (TsUtils.isClassOrInterfaceType(symbolType)) {
|
|
70623
70575
|
const baseTypes = this.tsctx.tsChecker.getBaseTypes(symbolType);
|
|
70624
|
-
type = Query.from(baseTypes).map((t) => this.tsctx.type.ofTsType(t)).mapAndFilter((t) => t.kind === "structured" && t.
|
|
70576
|
+
type = Query.from(baseTypes).map((t) => this.tsctx.type.ofTsType(t)).mapAndFilter((t) => t.kind === "structured" && t.structuredTypeKind === 0 /* Class */ ? t : void 0).first();
|
|
70625
70577
|
if (type === void 0) {
|
|
70626
70578
|
type = this.tsctx.analyzer.getImplicitBaseTypeForStructuredType(this);
|
|
70627
70579
|
}
|
|
@@ -70636,7 +70588,7 @@ var TsGlobalClassOrInterfaceEntity = class {
|
|
|
70636
70588
|
const symbolType = this.tsctx.tsChecker.getDeclaredTypeOfSymbol(this.symbol);
|
|
70637
70589
|
if (TsUtils.isClassOrInterfaceType(symbolType)) {
|
|
70638
70590
|
const baseTypes = this.tsctx.tsChecker.getBaseTypes(symbolType);
|
|
70639
|
-
types = Query.from(baseTypes).map((t) => this.tsctx.type.ofTsType(t)).mapAndFilter((t) => t.kind === "structured" && t.
|
|
70591
|
+
types = Query.from(baseTypes).map((t) => this.tsctx.type.ofTsType(t)).mapAndFilter((t) => t.kind === "structured" && t.structuredTypeKind === 2 /* Aspect */ ? t : void 0).toArray();
|
|
70640
70592
|
}
|
|
70641
70593
|
return new OriginalBaseAspectTypes(types);
|
|
70642
70594
|
});
|
|
@@ -70688,6 +70640,9 @@ var SourceAndTsGlobalClassOrInterfaceMergeEntity = class {
|
|
|
70688
70640
|
this.members = new Cached();
|
|
70689
70641
|
this.sourceData = new SourcePackageStructuredTypeDeclarationData(tsctx.analyzer.dialectA, node, this);
|
|
70690
70642
|
}
|
|
70643
|
+
get structuredTypeKind() {
|
|
70644
|
+
return this.sourceData.structuredTypeKind;
|
|
70645
|
+
}
|
|
70691
70646
|
getNaming() {
|
|
70692
70647
|
return this.sourceData.getNaming();
|
|
70693
70648
|
}
|
|
@@ -70743,9 +70698,6 @@ var SourceAndTsGlobalClassOrInterfaceMergeEntity = class {
|
|
|
70743
70698
|
isAbstract() {
|
|
70744
70699
|
return this.sourceData.isAbstract();
|
|
70745
70700
|
}
|
|
70746
|
-
getStructuredTypeKind() {
|
|
70747
|
-
return this.sourceData.getStructuredTypeKind();
|
|
70748
|
-
}
|
|
70749
70701
|
getArity() {
|
|
70750
70702
|
return this.getTypeParameters().length;
|
|
70751
70703
|
}
|
|
@@ -70792,6 +70744,9 @@ var TsTypeLiteralEntity = class {
|
|
|
70792
70744
|
this.baseAspectTypes = new OriginalBaseAspectTypes([]);
|
|
70793
70745
|
this.members = new Cached();
|
|
70794
70746
|
}
|
|
70747
|
+
get structuredTypeKind() {
|
|
70748
|
+
return 2 /* Aspect */;
|
|
70749
|
+
}
|
|
70795
70750
|
getNaming() {
|
|
70796
70751
|
return new EntityNaming_anonymous();
|
|
70797
70752
|
}
|
|
@@ -70822,9 +70777,6 @@ var TsTypeLiteralEntity = class {
|
|
|
70822
70777
|
isAbstract() {
|
|
70823
70778
|
return false;
|
|
70824
70779
|
}
|
|
70825
|
-
getStructuredTypeKind() {
|
|
70826
|
-
return 2 /* Aspect */;
|
|
70827
|
-
}
|
|
70828
70780
|
getArity() {
|
|
70829
70781
|
return this.getTypeParameters().length;
|
|
70830
70782
|
}
|
|
@@ -70881,6 +70833,9 @@ var TsNamedTypeLiteralEntity = class {
|
|
|
70881
70833
|
this.hiding = new Cached();
|
|
70882
70834
|
this.name = this.tsctx.createName(this.owningNamedSymbol.name, "type");
|
|
70883
70835
|
}
|
|
70836
|
+
get structuredTypeKind() {
|
|
70837
|
+
return 2 /* Aspect */;
|
|
70838
|
+
}
|
|
70884
70839
|
getNaming() {
|
|
70885
70840
|
return new EntityNaming_named(this.getName());
|
|
70886
70841
|
}
|
|
@@ -70920,9 +70875,6 @@ var TsNamedTypeLiteralEntity = class {
|
|
|
70920
70875
|
isAbstract() {
|
|
70921
70876
|
return false;
|
|
70922
70877
|
}
|
|
70923
|
-
getStructuredTypeKind() {
|
|
70924
|
-
return 2 /* Aspect */;
|
|
70925
|
-
}
|
|
70926
70878
|
getArity() {
|
|
70927
70879
|
return this.getTypeParameters().length;
|
|
70928
70880
|
}
|
|
@@ -70973,6 +70925,9 @@ var SourceAndTsNamedTypeLiteralMergeEntity = class {
|
|
|
70973
70925
|
this.members = new Cached();
|
|
70974
70926
|
this.sourceData = new SourcePackageStructuredTypeDeclarationData(tsctx.analyzer.dialectA, node, this);
|
|
70975
70927
|
}
|
|
70928
|
+
get structuredTypeKind() {
|
|
70929
|
+
return this.sourceData.structuredTypeKind;
|
|
70930
|
+
}
|
|
70976
70931
|
getNaming() {
|
|
70977
70932
|
return this.sourceData.getNaming();
|
|
70978
70933
|
}
|
|
@@ -71010,9 +70965,6 @@ var SourceAndTsNamedTypeLiteralMergeEntity = class {
|
|
|
71010
70965
|
isAbstract() {
|
|
71011
70966
|
return this.sourceData.isAbstract();
|
|
71012
70967
|
}
|
|
71013
|
-
getStructuredTypeKind() {
|
|
71014
|
-
return this.sourceData.getStructuredTypeKind();
|
|
71015
|
-
}
|
|
71016
70968
|
getArity() {
|
|
71017
70969
|
return this.getTypeParameters().length;
|
|
71018
70970
|
}
|
|
@@ -71982,7 +71934,7 @@ var TsInteropContext = class {
|
|
|
71982
71934
|
);
|
|
71983
71935
|
Debug.assert(type.kind === "structured");
|
|
71984
71936
|
const constructor = TypeMemberLookup.ofType(this.analyzer, type).getConstructors(void 0).at(0);
|
|
71985
|
-
Debug.assertNotNull(constructor, `\u0422\u0438\u043F ${type.
|
|
71937
|
+
Debug.assertNotNull(constructor, `\u0422\u0438\u043F ${type.entity.getNaming()} \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043A\u043E\u043D\u0441\u0442\u0440\u0443\u043A\u0442\u043E\u0440.`);
|
|
71986
71938
|
return new TagType(type, this.wellKnownDeclarations.defaultImport, constructor, /* @__PURE__ */ new Map());
|
|
71987
71939
|
});
|
|
71988
71940
|
}
|
|
@@ -73321,21 +73273,20 @@ var BaseMemberConflictsValidator = class {
|
|
|
73321
73273
|
if (!this.isTypeMemberThatCanConflict(m)) {
|
|
73322
73274
|
return;
|
|
73323
73275
|
}
|
|
73324
|
-
const instantiated = this.analyzer.instantiateTypeMember(m, type.
|
|
73276
|
+
const instantiated = this.analyzer.instantiateTypeMember(m, type.substitutions);
|
|
73325
73277
|
this.addOverriddenMembersRecursively(instantiated, overriddenMembers);
|
|
73326
73278
|
});
|
|
73327
73279
|
const result = new TypeMemberSet();
|
|
73328
73280
|
const allBaseTypes = this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(type);
|
|
73329
73281
|
for (const baseType of allBaseTypes) {
|
|
73330
|
-
|
|
73331
|
-
if (baseTypeEntity === void 0 || !isTypeEntityWithMembers(baseTypeEntity)) {
|
|
73282
|
+
if (baseType.entity === void 0 || !isTypeEntityWithMembers(baseType.entity)) {
|
|
73332
73283
|
continue;
|
|
73333
73284
|
}
|
|
73334
|
-
for (const baseTypeMemberEntity of
|
|
73285
|
+
for (const baseTypeMemberEntity of baseType.entity.getMembers().getAll()) {
|
|
73335
73286
|
if (!this.isTypeMemberThatCanConflict(baseTypeMemberEntity)) {
|
|
73336
73287
|
continue;
|
|
73337
73288
|
}
|
|
73338
|
-
const baseTypeMember = this.analyzer.instantiateTypeMember(baseTypeMemberEntity, baseType.
|
|
73289
|
+
const baseTypeMember = this.analyzer.instantiateTypeMember(baseTypeMemberEntity, baseType.substitutions);
|
|
73339
73290
|
if (result.add(baseTypeMember)) {
|
|
73340
73291
|
this.addOverriddenMembersRecursively(baseTypeMember, overriddenMembers);
|
|
73341
73292
|
}
|
|
@@ -73942,7 +73893,7 @@ var InstanceFieldsInitializationValidator = class {
|
|
|
73942
73893
|
return;
|
|
73943
73894
|
}
|
|
73944
73895
|
const typeEntity = this.analyzer.entity.ofTypeWithMembersDeclaration(this.typeDeclaration);
|
|
73945
|
-
if (typeEntity.typeEntityKind === 4 /* Alias */ || typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.
|
|
73896
|
+
if (typeEntity.typeEntityKind === 4 /* Alias */ || typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
73946
73897
|
return;
|
|
73947
73898
|
}
|
|
73948
73899
|
const fields = this.getFieldsThatNeedToBeInitializedInConstructor(typeEntity);
|
|
@@ -75144,7 +75095,7 @@ var SourceFileAnalyzer = class {
|
|
|
75144
75095
|
this.diagnosticAcceptor
|
|
75145
75096
|
).validate();
|
|
75146
75097
|
}
|
|
75147
|
-
if (entity.
|
|
75098
|
+
if (entity.structuredTypeKind === 1 /* Structure */) {
|
|
75148
75099
|
const declarationUsageCountResult = yield this.analyzer.getDeclarationsUsageOfSourceFile(
|
|
75149
75100
|
this.sourceFile.getSyntaxNode(),
|
|
75150
75101
|
controller.task
|
|
@@ -75237,7 +75188,7 @@ var SourceFileAnalyzer = class {
|
|
|
75237
75188
|
return __async(this, null, function* () {
|
|
75238
75189
|
switch (fieldType.kind) {
|
|
75239
75190
|
case "structured":
|
|
75240
|
-
if (fieldType.
|
|
75191
|
+
if (fieldType.structuredTypeKind === 1 /* Structure */) {
|
|
75241
75192
|
return yield this.checkStructureIsReferencedByFieldsOfStructure(
|
|
75242
75193
|
initialType,
|
|
75243
75194
|
fieldType,
|
|
@@ -75300,7 +75251,7 @@ var SourceFileAnalyzer = class {
|
|
|
75300
75251
|
}
|
|
75301
75252
|
checkStructureIsReferencedByFieldsOfStructure(initialType, fieldType, referencedTypes, taskController) {
|
|
75302
75253
|
return __async(this, null, function* () {
|
|
75303
|
-
const typeHasStoredVariables = fieldType.
|
|
75254
|
+
const typeHasStoredVariables = fieldType.entity.getMembers().getNamedMembersA().some((m) => m.kind === 0 /* Variable */ && !m.isStatic() && !isVariableEntityWithExplicitAccessors(m));
|
|
75304
75255
|
if (!typeHasStoredVariables) {
|
|
75305
75256
|
return false;
|
|
75306
75257
|
}
|
|
@@ -75368,7 +75319,7 @@ var SourceFileAnalyzer = class {
|
|
|
75368
75319
|
return;
|
|
75369
75320
|
}
|
|
75370
75321
|
const unaliasedBaseType = baseType.unalias();
|
|
75371
|
-
if (unaliasedBaseType.
|
|
75322
|
+
if (unaliasedBaseType.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object) {
|
|
75372
75323
|
return;
|
|
75373
75324
|
}
|
|
75374
75325
|
const semanticContext = this.analyzer.semanticContext.outermostSemanticContextOfTypeDeclaration(typeDeclaration);
|
|
@@ -75398,7 +75349,7 @@ var SourceFileAnalyzer = class {
|
|
|
75398
75349
|
continue;
|
|
75399
75350
|
}
|
|
75400
75351
|
allBaseTypes ??= this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(type);
|
|
75401
|
-
const extendedAspect = allBaseTypes.find((t) => t.kind === "structured" && t.
|
|
75352
|
+
const extendedAspect = allBaseTypes.find((t) => t.kind === "structured" && t.entity.getOriginalEntity() === unaliasedBaseAspectType.entity?.getOriginalEntity() && !t.substitutions.equals(unaliasedBaseAspectType.substitutions));
|
|
75402
75353
|
if (extendedAspect !== void 0) {
|
|
75403
75354
|
const diagnosticLocation = baseTypeList.baseTypes.first((n) => this.analyzer.type.ofTypeSpecifier(n).equals(baseAspectType)) ?? fallbackDiagnosticLocation;
|
|
75404
75355
|
this.createAndAddDiagnostic(
|
|
@@ -75800,7 +75751,7 @@ var SourceFileAnalyzer = class {
|
|
|
75800
75751
|
}
|
|
75801
75752
|
if (node2.kind === 10 /* NamedTypeSpecifier */) {
|
|
75802
75753
|
const type = this.analyzer.resolveNamedTypeSpecifier(node2).type;
|
|
75803
|
-
if (type?.kind === "parameter" && notYetDeclaredParameters.has(type.
|
|
75754
|
+
if (type?.kind === "parameter" && notYetDeclaredParameters.has(type.entity.getOriginalEntity())) {
|
|
75804
75755
|
this.createAndAddDiagnostic(
|
|
75805
75756
|
2189 /* TypeParameterDefaultCanReferenceOnlyPreviouslyDeclaredTypeParameters */,
|
|
75806
75757
|
node2
|
|
@@ -75851,7 +75802,7 @@ var SourceFileAnalyzer = class {
|
|
|
75851
75802
|
checkNamedTypeSpecifier(node) {
|
|
75852
75803
|
const resolutionResult = this.analyzer.resolveNamedTypeSpecifier(node);
|
|
75853
75804
|
if (resolutionResult.type !== void 0) {
|
|
75854
|
-
const entity = resolutionResult.type.
|
|
75805
|
+
const entity = resolutionResult.type.entity;
|
|
75855
75806
|
if (entity !== void 0) {
|
|
75856
75807
|
const typeArgumentCount = node.typeArgumentClause?.typeArgumentList.typeArguments.count() ?? 0;
|
|
75857
75808
|
this.analyzer.checkTypeArgumentCount(
|
|
@@ -75860,7 +75811,7 @@ var SourceFileAnalyzer = class {
|
|
|
75860
75811
|
this.diagnosticAcceptor,
|
|
75861
75812
|
node.typeArgumentClause ?? node.qualifiedName
|
|
75862
75813
|
);
|
|
75863
|
-
const substitutions = resolutionResult.type.
|
|
75814
|
+
const substitutions = resolutionResult.type.substitutions;
|
|
75864
75815
|
this.checkTypeArgumentTypesAreAssignableToConstraints(
|
|
75865
75816
|
entity.getTypeParameters(),
|
|
75866
75817
|
substitutions,
|
|
@@ -76246,7 +76197,7 @@ var SourceFileAnalyzer = class {
|
|
|
76246
76197
|
this.analyzer.getTargetTypeOfExpression(node.expression)
|
|
76247
76198
|
);
|
|
76248
76199
|
const expressionType = this.analyzer.type.ofExpression(node.expression);
|
|
76249
|
-
if (expressionType.
|
|
76200
|
+
if (expressionType.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.impossibleCase) {
|
|
76250
76201
|
const controlFlowNode = this.analyzer.getControlFlowGraph(this.sourceFile).controlFlowNodesPrecedingErrorStatement.get(node);
|
|
76251
76202
|
if (controlFlowNode !== void 0 && this.analyzer.reachabilityChecker.isControlFlowNodeReachable(controlFlowNode)) {
|
|
76252
76203
|
this.createAndAddDiagnostic(2216 /* TheCodeWasExpectedToBeUnreachable */, node);
|
|
@@ -76989,7 +76940,7 @@ var SourceFileAnalyzer = class {
|
|
|
76989
76940
|
}
|
|
76990
76941
|
checkAssignmentToObjectExpression(node) {
|
|
76991
76942
|
const type = this.analyzer.type.ofExpression(node);
|
|
76992
|
-
let canAssignToObject = type.kind === "structured" && type.
|
|
76943
|
+
let canAssignToObject = type.kind === "structured" && type.structuredTypeKind === 1 /* Structure */;
|
|
76993
76944
|
if (!canAssignToObject) {
|
|
76994
76945
|
const semanticContext = this.analyzer.semanticContext.containing(node);
|
|
76995
76946
|
const containingSubprogram = semanticContext.getContainingSubprogram();
|
|
@@ -77616,27 +77567,27 @@ var ReferencedPackagesCollector = class {
|
|
|
77616
77567
|
visitType(type) {
|
|
77617
77568
|
switch (type.kind) {
|
|
77618
77569
|
case "function":
|
|
77619
|
-
this.visitTypeEntity(type.
|
|
77620
|
-
this.visitTypeArguments(type.
|
|
77570
|
+
this.visitTypeEntity(type.entity, false);
|
|
77571
|
+
this.visitTypeArguments(type.substitutions);
|
|
77621
77572
|
break;
|
|
77622
77573
|
case "structured":
|
|
77623
|
-
this.visitTypeEntity(type.
|
|
77624
|
-
this.visitTypeArguments(type.
|
|
77574
|
+
this.visitTypeEntity(type.entity, false);
|
|
77575
|
+
this.visitTypeArguments(type.substitutions);
|
|
77625
77576
|
break;
|
|
77626
77577
|
case "variant":
|
|
77627
|
-
this.visitTypeEntity(type.
|
|
77628
|
-
this.visitTypeArguments(type.
|
|
77578
|
+
this.visitTypeEntity(type.entity, false);
|
|
77579
|
+
this.visitTypeArguments(type.substitutions);
|
|
77629
77580
|
break;
|
|
77630
77581
|
case "alias":
|
|
77631
|
-
this.visitTypeEntity(type.
|
|
77632
|
-
this.visitTypeArguments(type.
|
|
77582
|
+
this.visitTypeEntity(type.entity, false);
|
|
77583
|
+
this.visitTypeArguments(type.substitutions);
|
|
77633
77584
|
break;
|
|
77634
77585
|
case "reduced":
|
|
77635
|
-
this.visitTypeEntity(type.
|
|
77636
|
-
this.visitTypeArguments(type.
|
|
77586
|
+
this.visitTypeEntity(type.entity, false);
|
|
77587
|
+
this.visitTypeArguments(type.substitutions);
|
|
77637
77588
|
break;
|
|
77638
77589
|
case "parameter":
|
|
77639
|
-
this.visitTypeEntity(type.
|
|
77590
|
+
this.visitTypeEntity(type.entity, false);
|
|
77640
77591
|
break;
|
|
77641
77592
|
case "union": {
|
|
77642
77593
|
for (const constituentType of type.originalTypes) {
|
|
@@ -77857,10 +77808,8 @@ var ResolvedImplementationPackage = class _ResolvedImplementationPackage {
|
|
|
77857
77808
|
return true;
|
|
77858
77809
|
case 4 /* Alias */:
|
|
77859
77810
|
return entity.getMembers().getAll().length === 0;
|
|
77860
|
-
case 1 /* Structured */:
|
|
77861
|
-
|
|
77862
|
-
return structuredTypeKind === 2 /* Aspect */ && entity.getMembers().getAll().every((m) => TypeMemberEntity.isAbstract(m));
|
|
77863
|
-
}
|
|
77811
|
+
case 1 /* Structured */:
|
|
77812
|
+
return entity.structuredTypeKind === 2 /* Aspect */ && entity.getMembers().getAll().every((m) => TypeMemberEntity.isAbstract(m));
|
|
77864
77813
|
case 2 /* Parameter */:
|
|
77865
77814
|
case 3 /* Variant */:
|
|
77866
77815
|
return false;
|
|
@@ -78082,13 +78031,13 @@ var ResolvedImplementationPackage = class _ResolvedImplementationPackage {
|
|
|
78082
78031
|
case "function":
|
|
78083
78032
|
case "alias":
|
|
78084
78033
|
case "reduced": {
|
|
78085
|
-
const type2Entity = type2.
|
|
78034
|
+
const type2Entity = type2.entity;
|
|
78086
78035
|
if (type2Entity === void 0 || !isTypeEntityWithMembers(type2Entity)) {
|
|
78087
78036
|
return false;
|
|
78088
78037
|
}
|
|
78089
|
-
const entity1 = this.analyzer.implementation.ofTypeWithMembers(type1.
|
|
78090
|
-
const entity2 = this.analyzer.implementation.ofTypeWithMembers(type2Entity, this.targetPlatform) ?? type2.
|
|
78091
|
-
return entity1 === entity2 && this.areEqualSubstitutions(type1.
|
|
78038
|
+
const entity1 = this.analyzer.implementation.ofTypeWithMembers(type1.entity, this.targetPlatform) ?? type1.entity;
|
|
78039
|
+
const entity2 = this.analyzer.implementation.ofTypeWithMembers(type2Entity, this.targetPlatform) ?? type2.entity;
|
|
78040
|
+
return entity1 === entity2 && this.areEqualSubstitutions(type1.substitutions, type2.substitutions);
|
|
78092
78041
|
}
|
|
78093
78042
|
case "parameter": {
|
|
78094
78043
|
if (type2.kind !== "parameter") {
|
|
@@ -78097,14 +78046,14 @@ var ResolvedImplementationPackage = class _ResolvedImplementationPackage {
|
|
|
78097
78046
|
if (type1.isNullExcluded !== type2.isNullExcluded) {
|
|
78098
78047
|
return false;
|
|
78099
78048
|
}
|
|
78100
|
-
const containingEntity1 = type1.
|
|
78101
|
-
const containingEntity = type2.
|
|
78049
|
+
const containingEntity1 = type1.entity.getContainingEntity();
|
|
78050
|
+
const containingEntity = type2.entity.getContainingEntity();
|
|
78102
78051
|
let result;
|
|
78103
78052
|
if (containingEntity1.kind === 1 /* Function */ || containingEntity.kind === 1 /* Function */) {
|
|
78104
78053
|
result = false;
|
|
78105
78054
|
} else {
|
|
78106
|
-
const entity1 = this.analyzer.implementation.ofParameterType(type1.
|
|
78107
|
-
const entity2 = this.analyzer.implementation.ofParameterType(type2.
|
|
78055
|
+
const entity1 = this.analyzer.implementation.ofParameterType(type1.entity, this.targetPlatform) ?? type1.entity;
|
|
78056
|
+
const entity2 = this.analyzer.implementation.ofParameterType(type2.entity, this.targetPlatform) ?? type2.entity;
|
|
78108
78057
|
result = entity1 === entity2;
|
|
78109
78058
|
}
|
|
78110
78059
|
return result;
|
|
@@ -78202,7 +78151,7 @@ var TypeMemberImplementationChecker = class {
|
|
|
78202
78151
|
}
|
|
78203
78152
|
check() {
|
|
78204
78153
|
const { notExplicitlyImplementedAbstractMembers, overriddenMembers } = this.getExplicitImplementationInfo();
|
|
78205
|
-
if (notExplicitlyImplementedAbstractMembers.length === 0 || this.typeEntity.typeEntityKind === 1 /* Structured */ && this.typeEntity.
|
|
78154
|
+
if (notExplicitlyImplementedAbstractMembers.length === 0 || this.typeEntity.typeEntityKind === 1 /* Structured */ && this.typeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
78206
78155
|
return new TypeMemberImplementationCheckResult(overriddenMembers, notExplicitlyImplementedAbstractMembers, [], []);
|
|
78207
78156
|
}
|
|
78208
78157
|
const notImplementedAbstractMemberIsConsideredError = !TypeEntity.isAbstract(this.typeEntity);
|
|
@@ -78335,7 +78284,7 @@ var TypeMemberImplementationChecker = class {
|
|
|
78335
78284
|
overriddenMembers.add(overriddenMember);
|
|
78336
78285
|
}
|
|
78337
78286
|
if (isAbstractType && TypeMemberEntity.isAbstract(ownMember)) {
|
|
78338
|
-
abstractMembers.add(this.analyzer.instantiateTypeMember(ownMember, type.
|
|
78287
|
+
abstractMembers.add(this.analyzer.instantiateTypeMember(ownMember, type.substitutions));
|
|
78339
78288
|
}
|
|
78340
78289
|
}
|
|
78341
78290
|
let transitivelyBaseAspectTypes;
|
|
@@ -78343,20 +78292,20 @@ var TypeMemberImplementationChecker = class {
|
|
|
78343
78292
|
const baseTypes = this.analyzer.typeUtils.getBaseOrAliasedTypes(type);
|
|
78344
78293
|
for (const baseType of baseTypes) {
|
|
78345
78294
|
const unaliasedBaseType = baseType.unalias();
|
|
78346
|
-
const baseTypeEntity = unaliasedBaseType.
|
|
78295
|
+
const baseTypeEntity = unaliasedBaseType.entity;
|
|
78347
78296
|
if (!(baseTypeEntity !== void 0 && isTypeEntityWithMembers(baseTypeEntity))) {
|
|
78348
78297
|
continue;
|
|
78349
78298
|
}
|
|
78350
|
-
if (baseTypeEntity.typeEntityKind === 1 /* Structured */ && baseTypeEntity.
|
|
78299
|
+
if (baseTypeEntity.typeEntityKind === 1 /* Structured */ && baseTypeEntity.structuredTypeKind === 0 /* Class */ && !baseTypeEntity.isAbstract()) {
|
|
78351
78300
|
continue;
|
|
78352
78301
|
}
|
|
78353
78302
|
const notImplementedAbstractBaseTypeMembers = this.analyzer.getTypeMemberImplementationCheckResult(baseTypeEntity).notImplementedAbstractMembers;
|
|
78354
78303
|
for (const baseTypeMember of notImplementedAbstractBaseTypeMembers) {
|
|
78355
|
-
const substitutedBaseTypeMember = baseTypeMember.applySubstitutions(unaliasedBaseType.
|
|
78304
|
+
const substitutedBaseTypeMember = baseTypeMember.applySubstitutions(unaliasedBaseType.substitutions);
|
|
78356
78305
|
if (!overriddenMembers.has(substitutedBaseTypeMember)) {
|
|
78357
78306
|
let isImplicitlyImplementedInBaseType = false;
|
|
78358
78307
|
const containingEntity = substitutedBaseTypeMember.getEntity().getContainingEntity();
|
|
78359
|
-
if (containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.
|
|
78308
|
+
if (containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && containingEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
78360
78309
|
transitivelyBaseAspectTypes ??= this.getTransitivelyBaseAspectTypes(type);
|
|
78361
78310
|
const containingType = this.analyzer.instantiateTypeWithSubstitutions(
|
|
78362
78311
|
containingEntity,
|
|
@@ -78382,11 +78331,11 @@ var TypeMemberImplementationChecker = class {
|
|
|
78382
78331
|
type = type.unalias();
|
|
78383
78332
|
const result = new TypeMemberSet();
|
|
78384
78333
|
for (const baseType of this.collectUnaliasedBaseTypesRecursively(type)) {
|
|
78385
|
-
const entity = baseType.
|
|
78334
|
+
const entity = baseType.entity;
|
|
78386
78335
|
if (entity !== void 0 && isTypeEntityWithMembers(entity)) {
|
|
78387
78336
|
const overriddenMembers = this.analyzer.getTypeMemberImplementationCheckResult(entity).overriddenMembers;
|
|
78388
78337
|
for (const overriddenMember of overriddenMembers) {
|
|
78389
|
-
const substitutedOverriddenMember = overriddenMember.applySubstitutions(baseType.
|
|
78338
|
+
const substitutedOverriddenMember = overriddenMember.applySubstitutions(baseType.substitutions);
|
|
78390
78339
|
result.add(substitutedOverriddenMember);
|
|
78391
78340
|
}
|
|
78392
78341
|
}
|
|
@@ -79754,7 +79703,7 @@ var InstanceFieldsInitializationValidator2 = class {
|
|
|
79754
79703
|
if (typeEntity.kind === 6 /* TypeExtension */) {
|
|
79755
79704
|
return;
|
|
79756
79705
|
}
|
|
79757
|
-
if (typeEntity.typeEntityKind === 4 /* Alias */ || typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.
|
|
79706
|
+
if (typeEntity.typeEntityKind === 4 /* Alias */ || typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
79758
79707
|
return;
|
|
79759
79708
|
}
|
|
79760
79709
|
const fields = this.getFieldsThatNeedToBeInitializedInConstructor(typeEntity);
|
|
@@ -80737,7 +80686,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
80737
80686
|
this.diagnosticAcceptor
|
|
80738
80687
|
).validate();
|
|
80739
80688
|
}
|
|
80740
|
-
if (entity.
|
|
80689
|
+
if (entity.structuredTypeKind === 1 /* Structure */) {
|
|
80741
80690
|
const declarationUsageCountResult = yield this.analyzer.getDeclarationsUsageOfSourceFile(
|
|
80742
80691
|
this.sourceFile.getSyntaxNode(),
|
|
80743
80692
|
controller.task
|
|
@@ -80849,7 +80798,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
80849
80798
|
return __async(this, null, function* () {
|
|
80850
80799
|
switch (fieldType.kind) {
|
|
80851
80800
|
case "structured":
|
|
80852
|
-
if (fieldType.
|
|
80801
|
+
if (fieldType.structuredTypeKind === 1 /* Structure */) {
|
|
80853
80802
|
return yield this.checkStructureIsReferencedByFieldsOfStructure(
|
|
80854
80803
|
initialType,
|
|
80855
80804
|
fieldType,
|
|
@@ -80912,7 +80861,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
80912
80861
|
}
|
|
80913
80862
|
checkStructureIsReferencedByFieldsOfStructure(initialType, fieldType, referencedTypes, taskController) {
|
|
80914
80863
|
return __async(this, null, function* () {
|
|
80915
|
-
const typeHasStoredVariables = fieldType.
|
|
80864
|
+
const typeHasStoredVariables = fieldType.entity.getMembers().getNamedMembersM().some((m) => m.kind === 0 /* Variable */ && !m.isStatic() && !isVariableEntityWithExplicitAccessors(m));
|
|
80916
80865
|
if (!typeHasStoredVariables) {
|
|
80917
80866
|
return false;
|
|
80918
80867
|
}
|
|
@@ -80980,7 +80929,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
80980
80929
|
return;
|
|
80981
80930
|
}
|
|
80982
80931
|
const unaliasedBaseType = baseType.unalias();
|
|
80983
|
-
if (unaliasedBaseType.
|
|
80932
|
+
if (unaliasedBaseType.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object) {
|
|
80984
80933
|
return;
|
|
80985
80934
|
}
|
|
80986
80935
|
const semanticContext = this.analyzer.semanticContext.outermostSemanticContextOfTypeOrExtensionDeclaration(typeDeclaration);
|
|
@@ -81010,7 +80959,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
81010
80959
|
continue;
|
|
81011
80960
|
}
|
|
81012
80961
|
allBaseTypes ??= this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(type);
|
|
81013
|
-
const extendedAspect = allBaseTypes.find((t) => t.kind === "structured" && t.
|
|
80962
|
+
const extendedAspect = allBaseTypes.find((t) => t.kind === "structured" && t.entity.getOriginalEntity() === unaliasedBaseAspectType.entity?.getOriginalEntity() && !t.substitutions.equals(unaliasedBaseAspectType.substitutions));
|
|
81014
80963
|
if (extendedAspect !== void 0) {
|
|
81015
80964
|
const diagnosticLocation = baseTypeList.baseTypes.first((n) => this.analyzer.type.ofTypeSpecifier(n).equals(baseAspectType)) ?? fallbackDiagnosticLocation;
|
|
81016
80965
|
this.createAndAddDiagnostic(
|
|
@@ -81392,7 +81341,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
81392
81341
|
}
|
|
81393
81342
|
if (node2.kind === 1069 /* NamedTypeSpecifier */) {
|
|
81394
81343
|
const type = this.analyzer.resolveNamedTypeSpecifier(node2).type;
|
|
81395
|
-
if (type?.kind === "parameter" && notYetDeclaredParameters.has(type.
|
|
81344
|
+
if (type?.kind === "parameter" && notYetDeclaredParameters.has(type.entity.getOriginalEntity())) {
|
|
81396
81345
|
this.createAndAddDiagnostic(
|
|
81397
81346
|
2189 /* TypeParameterDefaultCanReferenceOnlyPreviouslyDeclaredTypeParameters */,
|
|
81398
81347
|
node2
|
|
@@ -81443,7 +81392,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
81443
81392
|
checkNamedTypeSpecifier(node) {
|
|
81444
81393
|
const resolutionResult = this.analyzer.resolveNamedTypeSpecifier(node);
|
|
81445
81394
|
if (resolutionResult.type !== void 0) {
|
|
81446
|
-
const entity = resolutionResult.type.
|
|
81395
|
+
const entity = resolutionResult.type.entity;
|
|
81447
81396
|
if (entity !== void 0) {
|
|
81448
81397
|
const typeArgumentCount = node.typeArgumentClause?.typeArgumentList.typeArguments.count() ?? 0;
|
|
81449
81398
|
this.analyzer.checkTypeArgumentCount(
|
|
@@ -81452,7 +81401,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
81452
81401
|
this.diagnosticAcceptor,
|
|
81453
81402
|
node.typeArgumentClause ?? node.qualifiedName
|
|
81454
81403
|
);
|
|
81455
|
-
const substitutions = resolutionResult.type.
|
|
81404
|
+
const substitutions = resolutionResult.type.substitutions;
|
|
81456
81405
|
this.checkTypeArgumentTypesAreAssignableToConstraints(
|
|
81457
81406
|
entity.getTypeParameters(),
|
|
81458
81407
|
substitutions,
|
|
@@ -81892,7 +81841,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
81892
81841
|
this.analyzer.getTargetTypeOfExpression(node.expression)
|
|
81893
81842
|
);
|
|
81894
81843
|
const expressionType = this.analyzer.type.ofExpression(node.expression);
|
|
81895
|
-
if (expressionType.
|
|
81844
|
+
if (expressionType.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.impossibleCase) {
|
|
81896
81845
|
const controlFlowNode = this.analyzer.getControlFlowGraph(this.sourceFile).controlFlowNodesPrecedingErrorStatement.get(node);
|
|
81897
81846
|
if (controlFlowNode !== void 0 && this.analyzer.reachabilityChecker.isControlFlowNodeReachable(controlFlowNode)) {
|
|
81898
81847
|
this.createAndAddDiagnostic(2216 /* TheCodeWasExpectedToBeUnreachable */, node);
|
|
@@ -82708,7 +82657,7 @@ var SourceFileAnalyzer2 = class {
|
|
|
82708
82657
|
}
|
|
82709
82658
|
checkAssignmentToObjectExpression(node) {
|
|
82710
82659
|
const type = this.analyzer.type.ofExpression(node);
|
|
82711
|
-
let canAssignToObject = type.kind === "structured" && type.
|
|
82660
|
+
let canAssignToObject = type.kind === "structured" && type.structuredTypeKind === 1 /* Structure */;
|
|
82712
82661
|
if (!canAssignToObject) {
|
|
82713
82662
|
const semanticContext = this.analyzer.semanticContext.containing(node);
|
|
82714
82663
|
const containingSubprogram = semanticContext.getContainingSubprogram();
|
|
@@ -83094,20 +83043,20 @@ var Analyzer = class {
|
|
|
83094
83043
|
ifTypeEnumerableThenElementType(type) {
|
|
83095
83044
|
let result = void 0;
|
|
83096
83045
|
const enumerableEntity = this.originalWellKnownDeclarations.enumerable;
|
|
83097
|
-
if (type.
|
|
83046
|
+
if (type.entity?.getOriginalEntity() === enumerableEntity) {
|
|
83098
83047
|
const parameter = enumerableEntity.getTypeParameters()[0];
|
|
83099
83048
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
83100
|
-
result = type.
|
|
83049
|
+
result = type.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
83101
83050
|
}
|
|
83102
83051
|
return result;
|
|
83103
83052
|
}
|
|
83104
83053
|
ifTypeEnumeratorThenElementType(type) {
|
|
83105
83054
|
let result = void 0;
|
|
83106
83055
|
const enumeratorEntity = this.originalWellKnownDeclarations.enumerator;
|
|
83107
|
-
if (type.
|
|
83056
|
+
if (type.entity?.getOriginalEntity() === enumeratorEntity) {
|
|
83108
83057
|
const parameter = enumeratorEntity.getTypeParameters()[0];
|
|
83109
83058
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
83110
|
-
result = type.
|
|
83059
|
+
result = type.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
83111
83060
|
}
|
|
83112
83061
|
return result;
|
|
83113
83062
|
}
|
|
@@ -83121,7 +83070,7 @@ var Analyzer = class {
|
|
|
83121
83070
|
ifTypeArrayOrReadonlyArrayThenElementType(type) {
|
|
83122
83071
|
let result;
|
|
83123
83072
|
const { array, readonlyArray } = this.originalWellKnownDeclarations;
|
|
83124
|
-
const entity = type.
|
|
83073
|
+
const entity = type.entity?.getOriginalEntity();
|
|
83125
83074
|
if (entity !== void 0 && (entity === array || entity === readonlyArray)) {
|
|
83126
83075
|
let parameter;
|
|
83127
83076
|
if (entity === array) {
|
|
@@ -83131,17 +83080,17 @@ var Analyzer = class {
|
|
|
83131
83080
|
parameter = readonlyArray.getTypeParameters()[0];
|
|
83132
83081
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u041C\u0430\u0441\u0441\u0438\u0432\u0427\u0438\u0442\u0430\u0435\u043C\u044B\u0439 \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
83133
83082
|
}
|
|
83134
|
-
result = type.
|
|
83083
|
+
result = type.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
83135
83084
|
}
|
|
83136
83085
|
return result;
|
|
83137
83086
|
}
|
|
83138
83087
|
ifTypeReferenceThenReferencedType(type) {
|
|
83139
83088
|
let result;
|
|
83140
83089
|
const referenceEntity = this.originalWellKnownDeclarations.reference;
|
|
83141
|
-
if (type.kind === "structured" && type.
|
|
83090
|
+
if (type.kind === "structured" && type.entity.getOriginalEntity() === referenceEntity) {
|
|
83142
83091
|
const parameter = referenceEntity.getTypeParameters()[0];
|
|
83143
83092
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u0421\u0441\u044B\u043B\u043A\u0430 \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
83144
|
-
result = type.
|
|
83093
|
+
result = type.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
83145
83094
|
}
|
|
83146
83095
|
return result;
|
|
83147
83096
|
}
|
|
@@ -83228,7 +83177,7 @@ var Analyzer = class {
|
|
|
83228
83177
|
}
|
|
83229
83178
|
getImplicitBaseTypeForStructuredType(entity) {
|
|
83230
83179
|
let result;
|
|
83231
|
-
const structuredTypeKind = entity.
|
|
83180
|
+
const structuredTypeKind = entity.structuredTypeKind;
|
|
83232
83181
|
switch (structuredTypeKind) {
|
|
83233
83182
|
case 0 /* Class */: {
|
|
83234
83183
|
const originalEntity = entity.getOriginalEntity();
|
|
@@ -83383,7 +83332,7 @@ var Analyzer = class {
|
|
|
83383
83332
|
result = this.typeFactory.getUnionType(typesWithoutNull);
|
|
83384
83333
|
}
|
|
83385
83334
|
} else if (type.kind === "parameter" && this.canTypeParameterBeNull(type)) {
|
|
83386
|
-
result = this.typeFactory.getParameterType(type.
|
|
83335
|
+
result = this.typeFactory.getParameterType(type.entity, true);
|
|
83387
83336
|
} else if (type.isNullType) {
|
|
83388
83337
|
result = this.typeFactory.getUnionType([]);
|
|
83389
83338
|
} else {
|
|
@@ -83483,7 +83432,7 @@ var Analyzer = class {
|
|
|
83483
83432
|
}
|
|
83484
83433
|
isParameterVariadic(entity) {
|
|
83485
83434
|
const type = this.excludeNullFromType(entity.getType());
|
|
83486
|
-
return type.kind === "alias" && type.
|
|
83435
|
+
return type.kind === "alias" && type.entity.getOriginalEntity() === this.originalWellKnownDeclarations.parameterArray;
|
|
83487
83436
|
}
|
|
83488
83437
|
getDefaultTypeParameterConstraint(locale) {
|
|
83489
83438
|
return this.includeNullToType(this.getLocalizedStandardTypes(locale).object, locale);
|
|
@@ -84923,7 +84872,7 @@ var TypeAssignabilityCheck = class {
|
|
|
84923
84872
|
return 2 /* Identity */;
|
|
84924
84873
|
}
|
|
84925
84874
|
if (target.kind === "parameter") {
|
|
84926
|
-
if (source.kind === "parameter" && source.
|
|
84875
|
+
if (source.kind === "parameter" && source.entity === target.entity && (this.analyzer.canTypeParameterBeNull(target) || !this.analyzer.canTypeParameterBeNull(source))) {
|
|
84927
84876
|
return 2 /* Identity */;
|
|
84928
84877
|
} else {
|
|
84929
84878
|
return 1 /* NotAssignable */;
|
|
@@ -85158,7 +85107,7 @@ var TypeAssignabilityCheck = class {
|
|
|
85158
85107
|
let result;
|
|
85159
85108
|
if (isDerivedFromOrEqualsTo) {
|
|
85160
85109
|
result = 4 /* DerivedToBase */;
|
|
85161
|
-
if (source.
|
|
85110
|
+
if (source.structuredTypeKind === 1 /* Structure */) {
|
|
85162
85111
|
result |= 32 /* Boxing */;
|
|
85163
85112
|
}
|
|
85164
85113
|
} else {
|
|
@@ -85276,7 +85225,7 @@ var TypeComparabilityCheck = class {
|
|
|
85276
85225
|
return true;
|
|
85277
85226
|
}
|
|
85278
85227
|
}
|
|
85279
|
-
return type1.
|
|
85228
|
+
return type1.entity.getOriginalEntity() === type2.entity.getOriginalEntity();
|
|
85280
85229
|
} else if (type1.kind === "parameter") {
|
|
85281
85230
|
const type1Constraint = type1.constraint;
|
|
85282
85231
|
if (type1Constraint !== void 0) {
|
|
@@ -85543,8 +85492,8 @@ var TypeUtils2 = class {
|
|
|
85543
85492
|
return true;
|
|
85544
85493
|
}
|
|
85545
85494
|
if (!considerTypeArguments) {
|
|
85546
|
-
const sourceEntity = source.
|
|
85547
|
-
const targetEntity = target.
|
|
85495
|
+
const sourceEntity = source.entity?.getOriginalEntity();
|
|
85496
|
+
const targetEntity = target.entity?.getOriginalEntity();
|
|
85548
85497
|
if (sourceEntity !== void 0 && sourceEntity === targetEntity) {
|
|
85549
85498
|
return true;
|
|
85550
85499
|
}
|
|
@@ -85582,7 +85531,7 @@ var TypeUtils2 = class {
|
|
|
85582
85531
|
if (type2.kind !== type1.kind) {
|
|
85583
85532
|
return false;
|
|
85584
85533
|
}
|
|
85585
|
-
if (type1.
|
|
85534
|
+
if (type1.entity.subkind === "anonymous" || type2.entity.subkind === "anonymous") {
|
|
85586
85535
|
let result = type1.isAsync() === type2.isAsync();
|
|
85587
85536
|
if (result) {
|
|
85588
85537
|
const ownParameters = type1.getParameters();
|
|
@@ -85657,7 +85606,7 @@ var TypeUtils2 = class {
|
|
|
85657
85606
|
if (type.kind !== "structured") {
|
|
85658
85607
|
return false;
|
|
85659
85608
|
}
|
|
85660
|
-
return Query.any(this.allAspectsOfType(type), (a) => a.
|
|
85609
|
+
return Query.any(this.allAspectsOfType(type), (a) => a.entity.getOriginalEntity() === aspectEntity.getOriginalEntity());
|
|
85661
85610
|
}
|
|
85662
85611
|
collectBaseAndAliasedTypesRecursively(type, result) {
|
|
85663
85612
|
switch (type.kind) {
|
|
@@ -85740,9 +85689,9 @@ var TypeUtils2 = class {
|
|
|
85740
85689
|
const baseObjectType = type.getBaseObjectType();
|
|
85741
85690
|
if (baseObjectType !== void 0) {
|
|
85742
85691
|
this.addTypeAndCollectAllBaseTypes(baseObjectType, result);
|
|
85743
|
-
} else if (type.
|
|
85692
|
+
} else if (type.structuredTypeKind === 2 /* Aspect */) {
|
|
85744
85693
|
this.addTypeAndCollectAllBaseTypes(
|
|
85745
|
-
this.analyzer.getLocalizedStandardTypes(type.
|
|
85694
|
+
this.analyzer.getLocalizedStandardTypes(type.entity.getLocale()).object,
|
|
85746
85695
|
result
|
|
85747
85696
|
);
|
|
85748
85697
|
}
|
|
@@ -85758,9 +85707,9 @@ var TypeUtils2 = class {
|
|
|
85758
85707
|
this.addTypeAndCollectAllBaseTypes(baseObjectType, result);
|
|
85759
85708
|
} else {
|
|
85760
85709
|
const reductionSource = type.getReductionSource().unaliasAndGetReductionSource();
|
|
85761
|
-
if (reductionSource?.kind === "structured" && reductionSource.
|
|
85710
|
+
if (reductionSource?.kind === "structured" && reductionSource.structuredTypeKind === 2 /* Aspect */) {
|
|
85762
85711
|
this.addTypeAndCollectAllBaseTypes(
|
|
85763
|
-
this.analyzer.getLocalizedStandardTypes(type.
|
|
85712
|
+
this.analyzer.getLocalizedStandardTypes(type.entity.getLocale()).object,
|
|
85764
85713
|
result
|
|
85765
85714
|
);
|
|
85766
85715
|
}
|
|
@@ -92180,6 +92129,9 @@ var PackageStructuredTypeDeclarationEntity2 = class {
|
|
|
92180
92129
|
this.node = node;
|
|
92181
92130
|
this.data = new SourcePackageStructuredTypeDeclarationData2(analyzer, node, this);
|
|
92182
92131
|
}
|
|
92132
|
+
get structuredTypeKind() {
|
|
92133
|
+
return this.data.structuredTypeKind;
|
|
92134
|
+
}
|
|
92183
92135
|
getNaming() {
|
|
92184
92136
|
return this.data.getNaming();
|
|
92185
92137
|
}
|
|
@@ -92204,9 +92156,6 @@ var PackageStructuredTypeDeclarationEntity2 = class {
|
|
|
92204
92156
|
isAbstract() {
|
|
92205
92157
|
return this.data.isAbstract();
|
|
92206
92158
|
}
|
|
92207
|
-
getStructuredTypeKind() {
|
|
92208
|
-
return this.data.getStructuredTypeKind();
|
|
92209
|
-
}
|
|
92210
92159
|
getArity() {
|
|
92211
92160
|
return this.data.getArity();
|
|
92212
92161
|
}
|
|
@@ -92249,6 +92198,9 @@ var LocalStructuredTypeDeclarationEntity = class {
|
|
|
92249
92198
|
this.node = node;
|
|
92250
92199
|
this.data = new SourceLocalStructuredTypeDeclarationData(analyzer, node, this);
|
|
92251
92200
|
}
|
|
92201
|
+
get structuredTypeKind() {
|
|
92202
|
+
return this.data.structuredTypeKind;
|
|
92203
|
+
}
|
|
92252
92204
|
getNaming() {
|
|
92253
92205
|
return this.data.getNaming();
|
|
92254
92206
|
}
|
|
@@ -92270,9 +92222,6 @@ var LocalStructuredTypeDeclarationEntity = class {
|
|
|
92270
92222
|
isAbstract() {
|
|
92271
92223
|
return false;
|
|
92272
92224
|
}
|
|
92273
|
-
getStructuredTypeKind() {
|
|
92274
|
-
return this.data.getStructuredTypeKind();
|
|
92275
|
-
}
|
|
92276
92225
|
getBaseObjectType() {
|
|
92277
92226
|
return this.data.getBaseObjectType();
|
|
92278
92227
|
}
|
|
@@ -92323,7 +92272,7 @@ var SourceStructuredTypeDeclarationData2 = class {
|
|
|
92323
92272
|
return this.members.getOrInsertWith(() => {
|
|
92324
92273
|
const members = this.analyzer.getDeclaredTypeMemberEntities(this.typeNode);
|
|
92325
92274
|
const isInterfacePackageMember = this.entity.getContainingPackage().getInterfacePackageInfo() !== void 0;
|
|
92326
|
-
if (!(isInterfacePackageMember || this.
|
|
92275
|
+
if (!(isInterfacePackageMember || this.structuredTypeKind === 2 /* Aspect */)) {
|
|
92327
92276
|
if (members.find((m) => TypeMemberEntity.isConstructor(m)) === void 0) {
|
|
92328
92277
|
const fields = members.filter((m) => m.kind === 0 /* Variable */);
|
|
92329
92278
|
const defaultConstructors = this.analyzer.createDefaultConstructors(this.entity, fields);
|
|
@@ -92362,18 +92311,18 @@ var SourceStructuredTypeDeclarationData2 = class {
|
|
|
92362
92311
|
const baseType = this.analyzer.type.ofTypeSpecifier(baseTypeSpecifier);
|
|
92363
92312
|
const unaliasedBaseType = baseType.unalias();
|
|
92364
92313
|
if (unaliasedBaseType.kind === "structured") {
|
|
92365
|
-
if (unaliasedBaseType.
|
|
92314
|
+
if (unaliasedBaseType.structuredTypeKind === 0 /* Class */) {
|
|
92366
92315
|
if (declaredBaseObjectType !== void 0) {
|
|
92367
92316
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
92368
92317
|
2131 /* TypeCannotHaveMultipleBaseObjectTypes */,
|
|
92369
92318
|
baseTypeSpecifier
|
|
92370
92319
|
));
|
|
92371
|
-
} else if (this.entity.
|
|
92320
|
+
} else if (this.entity.structuredTypeKind === 1 /* Structure */) {
|
|
92372
92321
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
92373
92322
|
2136 /* StructureCanHaveOnlyAspectsAsBaseTypes */,
|
|
92374
92323
|
baseTypeSpecifier
|
|
92375
92324
|
));
|
|
92376
|
-
} else if (this.entity.
|
|
92325
|
+
} else if (this.entity.structuredTypeKind === 2 /* Aspect */) {
|
|
92377
92326
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
92378
92327
|
2137 /* AspectTypeCanHaveOnlyAspectsAsBaseTypes */,
|
|
92379
92328
|
baseTypeSpecifier
|
|
@@ -92381,12 +92330,12 @@ var SourceStructuredTypeDeclarationData2 = class {
|
|
|
92381
92330
|
} else {
|
|
92382
92331
|
declaredBaseObjectType = baseType;
|
|
92383
92332
|
}
|
|
92384
|
-
} else if (unaliasedBaseType.
|
|
92333
|
+
} else if (unaliasedBaseType.structuredTypeKind === 1 /* Structure */) {
|
|
92385
92334
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
92386
92335
|
2133 /* StructureCannotBeUsedAsBaseType */,
|
|
92387
92336
|
baseTypeSpecifier
|
|
92388
92337
|
));
|
|
92389
|
-
} else if (unaliasedBaseType.
|
|
92338
|
+
} else if (unaliasedBaseType.structuredTypeKind === 2 /* Aspect */) {
|
|
92390
92339
|
if (declaredBaseAspectTypes.some((t) => t.unalias().equals(unaliasedBaseType))) {
|
|
92391
92340
|
diagnostics.addDiagnostic(this.analyzer.createDiagnostic(
|
|
92392
92341
|
2134 /* ThisTypeIsAlreadyListedInBaseTypeList */,
|
|
@@ -92413,13 +92362,26 @@ var SourcePackageStructuredTypeDeclarationData2 = class extends SourceStructured
|
|
|
92413
92362
|
constructor(analyzer, node, entity) {
|
|
92414
92363
|
super(analyzer);
|
|
92415
92364
|
this.typeParameters = new Cached();
|
|
92416
|
-
this.
|
|
92365
|
+
this.structuredTypeKind_ = new Cached();
|
|
92417
92366
|
this.hiding = new Cached();
|
|
92418
92367
|
this.modifierFlags_ = 2048 /* NotComputed */;
|
|
92419
92368
|
this.node = node;
|
|
92420
92369
|
this.entity = entity;
|
|
92421
92370
|
this.name = analyzer.createNameFromIdentifier(node.name);
|
|
92422
92371
|
}
|
|
92372
|
+
get structuredTypeKind() {
|
|
92373
|
+
return this.structuredTypeKind_.getOrInsertWith(() => {
|
|
92374
|
+
const tagPlainM = this.analyzer.tags.ofNodeWithTags(this.typeNode).find((it) => it.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.tagPlainM.getOriginalEntity()) !== void 0;
|
|
92375
|
+
const tagAspectM = this.analyzer.tags.ofNodeWithTags(this.typeNode).find((it) => it.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.tagAspectM.getOriginalEntity()) !== void 0;
|
|
92376
|
+
if (tagPlainM) {
|
|
92377
|
+
return 1 /* Structure */;
|
|
92378
|
+
}
|
|
92379
|
+
if (tagAspectM) {
|
|
92380
|
+
return 2 /* Aspect */;
|
|
92381
|
+
}
|
|
92382
|
+
return 0 /* Class */;
|
|
92383
|
+
});
|
|
92384
|
+
}
|
|
92423
92385
|
get typeNode() {
|
|
92424
92386
|
return this.node;
|
|
92425
92387
|
}
|
|
@@ -92456,21 +92418,11 @@ var SourcePackageStructuredTypeDeclarationData2 = class extends SourceStructured
|
|
|
92456
92418
|
getSubstitutionApplicationMode() {
|
|
92457
92419
|
return 0 /* SubstituteOwnSubstitutions */;
|
|
92458
92420
|
}
|
|
92459
|
-
getStructuredTypeKind() {
|
|
92460
|
-
return this.structuredTypeKind.getOrInsertWith(() => {
|
|
92461
|
-
const tagPlainM = this.analyzer.tags.ofNodeWithTags(this.typeNode).find((it) => it.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.tagPlainM.getOriginalEntity()) !== void 0;
|
|
92462
|
-
const tagAspectM = this.analyzer.tags.ofNodeWithTags(this.typeNode).find((it) => it.entity.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.tagAspectM.getOriginalEntity()) !== void 0;
|
|
92463
|
-
if (tagPlainM) {
|
|
92464
|
-
return 1 /* Structure */;
|
|
92465
|
-
}
|
|
92466
|
-
if (tagAspectM) {
|
|
92467
|
-
return 2 /* Aspect */;
|
|
92468
|
-
}
|
|
92469
|
-
return 0 /* Class */;
|
|
92470
|
-
});
|
|
92471
|
-
}
|
|
92472
92421
|
};
|
|
92473
92422
|
var SourceLocalStructuredTypeDeclarationData = class extends SourceStructuredTypeDeclarationData2 {
|
|
92423
|
+
get structuredTypeKind() {
|
|
92424
|
+
return 0 /* Class */;
|
|
92425
|
+
}
|
|
92474
92426
|
get typeNode() {
|
|
92475
92427
|
return this.node;
|
|
92476
92428
|
}
|
|
@@ -92495,9 +92447,6 @@ var SourceLocalStructuredTypeDeclarationData = class extends SourceStructuredTyp
|
|
|
92495
92447
|
getSubstitutionApplicationMode() {
|
|
92496
92448
|
return 1 /* SubstituteOwnSubstitutionsAndMerge */;
|
|
92497
92449
|
}
|
|
92498
|
-
getStructuredTypeKind() {
|
|
92499
|
-
return 0 /* Class */;
|
|
92500
|
-
}
|
|
92501
92450
|
getName() {
|
|
92502
92451
|
return this.name;
|
|
92503
92452
|
}
|
|
@@ -93300,7 +93249,7 @@ var Resolver = class {
|
|
|
93300
93249
|
case 1 /* Structured */: {
|
|
93301
93250
|
const baseObjectType = typeEntity.getBaseObjectType();
|
|
93302
93251
|
let result = baseObjectType.cycleFree;
|
|
93303
|
-
if (result === void 0 && !isForBaseConstructorCall && typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.
|
|
93252
|
+
if (result === void 0 && !isForBaseConstructorCall && typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
93304
93253
|
result = this.analyzer.getLocalizedStandardTypes(typeEntity.getLocale()).object;
|
|
93305
93254
|
}
|
|
93306
93255
|
return result;
|
|
@@ -93474,7 +93423,7 @@ var TypeArgumentInferrer = class {
|
|
|
93474
93423
|
}
|
|
93475
93424
|
}
|
|
93476
93425
|
inferToParameterType(sourceType, targetType, priority) {
|
|
93477
|
-
const inferenceState = this.inferenceStates.find((s) => s.typeParameter.getOriginalEntity() === targetType.
|
|
93426
|
+
const inferenceState = this.inferenceStates.find((s) => s.typeParameter.getOriginalEntity() === targetType.entity.getOriginalEntity());
|
|
93478
93427
|
if (inferenceState !== void 0) {
|
|
93479
93428
|
if (sourceType === this.unresolvedType) {
|
|
93480
93429
|
this.inferenceHasFailed = true;
|
|
@@ -93488,18 +93437,18 @@ var TypeArgumentInferrer = class {
|
|
|
93488
93437
|
}
|
|
93489
93438
|
}
|
|
93490
93439
|
inferToStructuredType(sourceType, targetType, priority) {
|
|
93491
|
-
if (sourceType.
|
|
93492
|
-
this.inferFromSubstitutions(sourceType.
|
|
93440
|
+
if (sourceType.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity()) {
|
|
93441
|
+
this.inferFromSubstitutions(sourceType.substitutions, targetType.substitutions, priority);
|
|
93493
93442
|
} else {
|
|
93494
|
-
const baseType = this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(sourceType).find((t) => t.
|
|
93443
|
+
const baseType = this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(sourceType).find((t) => t.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity());
|
|
93495
93444
|
if (baseType !== void 0) {
|
|
93496
|
-
this.inferFromSubstitutions(baseType.
|
|
93445
|
+
this.inferFromSubstitutions(baseType.substitutions, targetType.substitutions, priority);
|
|
93497
93446
|
}
|
|
93498
93447
|
}
|
|
93499
93448
|
}
|
|
93500
93449
|
inferToReducedType(sourceType, targetType, priority) {
|
|
93501
|
-
if (sourceType.
|
|
93502
|
-
this.inferFromSubstitutions(sourceType.
|
|
93450
|
+
if (sourceType.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity()) {
|
|
93451
|
+
this.inferFromSubstitutions(sourceType.substitutions, targetType.substitutions, priority);
|
|
93503
93452
|
} else {
|
|
93504
93453
|
this.inferFromTypes(sourceType, targetType.getReductionSource(), priority);
|
|
93505
93454
|
}
|
|
@@ -93643,30 +93592,30 @@ var TypeArgumentInferrer = class {
|
|
|
93643
93592
|
typeContainsTypeParameter(type, typeParameterEntity) {
|
|
93644
93593
|
switch (type.kind) {
|
|
93645
93594
|
case "parameter":
|
|
93646
|
-
return type.
|
|
93595
|
+
return type.entity.getOriginalEntity() === typeParameterEntity.getOriginalEntity();
|
|
93647
93596
|
case "function": {
|
|
93648
93597
|
return type.getParameters().some((p) => this.typeContainsTypeParameter(p.getType(), typeParameterEntity)) || this.typeContainsTypeParameter(type.getReturnType(), typeParameterEntity);
|
|
93649
93598
|
}
|
|
93650
93599
|
case "structured": {
|
|
93651
|
-
const isNamed = isNamedTypeEntity(type.
|
|
93600
|
+
const isNamed = isNamedTypeEntity(type.entity);
|
|
93652
93601
|
if (isNamed) {
|
|
93653
|
-
return this.substitutionsContainTypeParameter(type.
|
|
93602
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
93654
93603
|
} else {
|
|
93655
93604
|
return false;
|
|
93656
93605
|
}
|
|
93657
93606
|
}
|
|
93658
93607
|
case "variant": {
|
|
93659
|
-
const isNamed = isNamedTypeEntity(type.
|
|
93608
|
+
const isNamed = isNamedTypeEntity(type.entity);
|
|
93660
93609
|
if (isNamed) {
|
|
93661
|
-
return this.substitutionsContainTypeParameter(type.
|
|
93610
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
93662
93611
|
} else {
|
|
93663
93612
|
return false;
|
|
93664
93613
|
}
|
|
93665
93614
|
}
|
|
93666
93615
|
case "alias":
|
|
93667
|
-
return this.substitutionsContainTypeParameter(type.
|
|
93616
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
93668
93617
|
case "reduced":
|
|
93669
|
-
return this.substitutionsContainTypeParameter(type.
|
|
93618
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
93670
93619
|
case "union":
|
|
93671
93620
|
return type.originalTypes.some((t) => this.typeContainsTypeParameter(t, typeParameterEntity));
|
|
93672
93621
|
case "intersection":
|
|
@@ -94033,7 +93982,7 @@ var OverloadResolver = class {
|
|
|
94033
93982
|
}
|
|
94034
93983
|
functionLiteralCouldBeAssignableToType(type) {
|
|
94035
93984
|
type = type.unalias();
|
|
94036
|
-
return type.
|
|
93985
|
+
return type.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object || type.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.func || type.kind === "function" || type.kind === "union" && type.originalTypes.some((t) => this.functionLiteralCouldBeAssignableToType(t));
|
|
94037
93986
|
}
|
|
94038
93987
|
reportAmbiguousAccessDiagnostic(signatures) {
|
|
94039
93988
|
if (this.diagnostics !== void 0 && this.nodesForDiagnostic?.access !== void 0) {
|
|
@@ -94189,7 +94138,7 @@ var Resolver3 = class {
|
|
|
94189
94138
|
));
|
|
94190
94139
|
}
|
|
94191
94140
|
return ResolutionResult.empty;
|
|
94192
|
-
} else if (singleTypeEntity.typeEntityKind === 1 /* Structured */ && singleTypeEntity.
|
|
94141
|
+
} else if (singleTypeEntity.typeEntityKind === 1 /* Structured */ && singleTypeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
94193
94142
|
if (diagnostics !== void 0 && diagnosticLocation !== void 0) {
|
|
94194
94143
|
diagnostics.addDiagnostic(analyzer.createDiagnostic(
|
|
94195
94144
|
2013 /* CannotCreateInstanceOfAspect */,
|
|
@@ -94317,7 +94266,7 @@ var Resolver3 = class {
|
|
|
94317
94266
|
case 5 /* Reduced */:
|
|
94318
94267
|
return true;
|
|
94319
94268
|
case 1 /* Structured */:
|
|
94320
|
-
return !(entity.
|
|
94269
|
+
return !(entity.structuredTypeKind === 2 /* Aspect */ || entity.isAbstract());
|
|
94321
94270
|
case 2 /* Parameter */:
|
|
94322
94271
|
return false;
|
|
94323
94272
|
default:
|
|
@@ -94751,11 +94700,11 @@ var Resolver5 = class {
|
|
|
94751
94700
|
case 1 /* Structured */:
|
|
94752
94701
|
case 3 /* Variant */:
|
|
94753
94702
|
case 0 /* Function */:
|
|
94754
|
-
return typeEntity.getBaseObjectType().cycleFree?.
|
|
94703
|
+
return typeEntity.getBaseObjectType().cycleFree?.entity;
|
|
94755
94704
|
case 4 /* Alias */:
|
|
94756
|
-
return typeEntity.getAliasedType().cycleFree?.
|
|
94705
|
+
return typeEntity.getAliasedType().cycleFree?.entity;
|
|
94757
94706
|
case 5 /* Reduced */:
|
|
94758
|
-
return typeEntity.getReductionSource().cycleFree?.
|
|
94707
|
+
return typeEntity.getReductionSource().cycleFree?.entity;
|
|
94759
94708
|
default:
|
|
94760
94709
|
Debug.never(typeEntity);
|
|
94761
94710
|
}
|
|
@@ -94931,7 +94880,7 @@ var DeclarationsUsageCounter = class {
|
|
|
94931
94880
|
this.recordUsage(meaning.packageAlias, void 0);
|
|
94932
94881
|
break;
|
|
94933
94882
|
case "type-access": {
|
|
94934
|
-
const entity = meaning.singleSuitableType?.
|
|
94883
|
+
const entity = meaning.singleSuitableType?.entity;
|
|
94935
94884
|
if (entity !== void 0) {
|
|
94936
94885
|
this.recordUsage(entity, void 0);
|
|
94937
94886
|
}
|
|
@@ -94969,7 +94918,7 @@ var DeclarationsUsageCounter = class {
|
|
|
94969
94918
|
entity = meaning.suitableOrSingleFunction?.getEntity();
|
|
94970
94919
|
break;
|
|
94971
94920
|
case "package-type-access":
|
|
94972
|
-
entity = meaning.singleSuitableType?.
|
|
94921
|
+
entity = meaning.singleSuitableType?.entity;
|
|
94973
94922
|
break;
|
|
94974
94923
|
case "type-access-at-constructor-call":
|
|
94975
94924
|
entity = meaning.callExpressionMeaning.typeEntity;
|
|
@@ -95003,7 +94952,7 @@ var DeclarationsUsageCounter = class {
|
|
|
95003
94952
|
}
|
|
95004
94953
|
case 1069 /* NamedTypeSpecifier */: {
|
|
95005
94954
|
const resolved = this.analyzer.resolveNamedTypeSpecifier(node);
|
|
95006
|
-
const entity = resolved.type?.
|
|
94955
|
+
const entity = resolved.type?.entity;
|
|
95007
94956
|
if (entity !== void 0) {
|
|
95008
94957
|
this.recordUsage(entity, void 0);
|
|
95009
94958
|
}
|
|
@@ -95625,7 +95574,7 @@ var FirstStageResolver = class {
|
|
|
95625
95574
|
}
|
|
95626
95575
|
}
|
|
95627
95576
|
const suitableTypes = suitableTypeEntities.map((c) => this.analyzer.instantiateType(c, typeArguments));
|
|
95628
|
-
if (suitableTypes.length >= 1 && suitableTypes[0].
|
|
95577
|
+
if (suitableTypes.length >= 1 && suitableTypes[0].entity?.typeEntityKind === 3 /* Variant */) {
|
|
95629
95578
|
if (diagnosticsAccumulating !== void 0) {
|
|
95630
95579
|
for (const diagnostic of diagnosticsAccumulating.items) {
|
|
95631
95580
|
this.diagnostics?.addDiagnostic(diagnostic);
|
|
@@ -97721,9 +97670,9 @@ var ReductionSourceMemberFinder = class _ReductionSourceMemberFinder {
|
|
|
97721
97670
|
const typeComparer = (t1, t2) => {
|
|
97722
97671
|
let result2 = t1.kind === "reduced" && t2.equals(reductionSource) && t1.getReductionSource().equals(reductionSource);
|
|
97723
97672
|
if (!result2) {
|
|
97724
|
-
result2 = t1.kind === t2.kind && t1.
|
|
97725
|
-
t1.
|
|
97726
|
-
t2.
|
|
97673
|
+
result2 = t1.kind === t2.kind && t1.entity?.getOriginalEntity() === t2.entity?.getOriginalEntity() && this.analyzer.typeUtils.compareSubstitutionsWithSimpleTypeComparer(
|
|
97674
|
+
t1.substitutions,
|
|
97675
|
+
t2.substitutions,
|
|
97727
97676
|
typeComparer
|
|
97728
97677
|
);
|
|
97729
97678
|
}
|
|
@@ -100743,20 +100692,20 @@ var Analyzer2 = class extends Analyzer {
|
|
|
100743
100692
|
} else {
|
|
100744
100693
|
const enumerableEntity = this.originalWellKnownDeclarations.enumerable;
|
|
100745
100694
|
let implementedEnumerableAspect;
|
|
100746
|
-
if (type.
|
|
100695
|
+
if (type.entity?.getOriginalEntity() === enumerableEntity) {
|
|
100747
100696
|
Debug.assert(type.kind === "structured");
|
|
100748
100697
|
implementedEnumerableAspect = type;
|
|
100749
100698
|
} else {
|
|
100750
|
-
implementedEnumerableAspect = Query.from(this.typeUtils.allAspectsOfType(type)).first((t) => t.
|
|
100699
|
+
implementedEnumerableAspect = Query.from(this.typeUtils.allAspectsOfType(type)).first((t) => t.entity.getOriginalEntity() === enumerableEntity);
|
|
100751
100700
|
}
|
|
100752
100701
|
if (implementedEnumerableAspect !== void 0) {
|
|
100753
100702
|
const parameter = enumerableEntity.getTypeParameters()[0];
|
|
100754
100703
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u041F\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043C\u044B\u0439 \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
100755
|
-
const elementType = implementedEnumerableAspect.
|
|
100704
|
+
const elementType = implementedEnumerableAspect.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
100756
100705
|
result = new WithDiagnostics_ok(new ExpressionCanBeUsedInForLoopCheckResult(elementType, void 0));
|
|
100757
100706
|
} else {
|
|
100758
100707
|
const semanticContext = this.semanticContext.containing(node);
|
|
100759
|
-
const typeLocale = type.
|
|
100708
|
+
const typeLocale = type.entity?.getLocale() ?? node.locale;
|
|
100760
100709
|
const enumeratorMethodName = LocalizationHelperM.localizeHelperPhrase(
|
|
100761
100710
|
8 /* EnumeratorMethodName */,
|
|
100762
100711
|
typeLocale
|
|
@@ -101542,7 +101491,7 @@ var Analyzer2 = class extends Analyzer {
|
|
|
101542
101491
|
}
|
|
101543
101492
|
createDefaultConstructors(typeEntity, fields) {
|
|
101544
101493
|
let result;
|
|
101545
|
-
const structuredTypeKind = typeEntity.
|
|
101494
|
+
const structuredTypeKind = typeEntity.structuredTypeKind;
|
|
101546
101495
|
if (structuredTypeKind === 0 /* Class */ || structuredTypeKind === 1 /* Structure */) {
|
|
101547
101496
|
const baseType = typeEntity.getBaseObjectType().cycleFree;
|
|
101548
101497
|
const variablesToInitialize = fields.filter((f) => !f.isStatic() && !isVariableEntityWithExplicitAccessors(f)).map((f) => {
|
|
@@ -102298,7 +102247,7 @@ var Type14 = class {
|
|
|
102298
102247
|
const targetArrayType = this.analyzer.getUnambiguousTargetArrayType(targetType);
|
|
102299
102248
|
const standardTypes = this.analyzer.getLocalizedStandardTypes(node.locale);
|
|
102300
102249
|
const elements = node.elementList.expressions.toArray();
|
|
102301
|
-
const arrayTypeEntity = standardTypes.array.
|
|
102250
|
+
const arrayTypeEntity = standardTypes.array.entity;
|
|
102302
102251
|
if (elements.length === 0) {
|
|
102303
102252
|
if (targetArrayType !== void 0) {
|
|
102304
102253
|
return targetArrayType;
|
|
@@ -107058,7 +107007,7 @@ var TypeArgumentInferrer2 = class {
|
|
|
107058
107007
|
}
|
|
107059
107008
|
}
|
|
107060
107009
|
inferToParameterType(sourceType, targetType, priority) {
|
|
107061
|
-
const inferenceState = this.inferenceStates.find((s) => s.typeParameter.getOriginalEntity() === targetType.
|
|
107010
|
+
const inferenceState = this.inferenceStates.find((s) => s.typeParameter.getOriginalEntity() === targetType.entity.getOriginalEntity());
|
|
107062
107011
|
if (inferenceState !== void 0) {
|
|
107063
107012
|
if (sourceType === this.unresolvedType) {
|
|
107064
107013
|
this.inferenceHasFailed = true;
|
|
@@ -107072,18 +107021,18 @@ var TypeArgumentInferrer2 = class {
|
|
|
107072
107021
|
}
|
|
107073
107022
|
}
|
|
107074
107023
|
inferToStructuredType(sourceType, targetType, priority) {
|
|
107075
|
-
if (sourceType.
|
|
107076
|
-
this.inferFromSubstitutions(sourceType.
|
|
107024
|
+
if (sourceType.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity()) {
|
|
107025
|
+
this.inferFromSubstitutions(sourceType.substitutions, targetType.substitutions, priority);
|
|
107077
107026
|
} else {
|
|
107078
|
-
const baseType = this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(sourceType).find((t) => t.
|
|
107027
|
+
const baseType = this.analyzer.typeUtils.getBaseAndAliasedTypesRecursively(sourceType).find((t) => t.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity());
|
|
107079
107028
|
if (baseType !== void 0) {
|
|
107080
|
-
this.inferFromSubstitutions(baseType.
|
|
107029
|
+
this.inferFromSubstitutions(baseType.substitutions, targetType.substitutions, priority);
|
|
107081
107030
|
}
|
|
107082
107031
|
}
|
|
107083
107032
|
}
|
|
107084
107033
|
inferToReducedType(sourceType, targetType, priority) {
|
|
107085
|
-
if (sourceType.
|
|
107086
|
-
this.inferFromSubstitutions(sourceType.
|
|
107034
|
+
if (sourceType.entity?.getOriginalEntity() === targetType.entity.getOriginalEntity()) {
|
|
107035
|
+
this.inferFromSubstitutions(sourceType.substitutions, targetType.substitutions, priority);
|
|
107087
107036
|
} else {
|
|
107088
107037
|
this.inferFromTypes(sourceType, targetType.getReductionSource(), priority);
|
|
107089
107038
|
}
|
|
@@ -107230,30 +107179,30 @@ var TypeArgumentInferrer2 = class {
|
|
|
107230
107179
|
typeContainsTypeParameter(type, typeParameterEntity) {
|
|
107231
107180
|
switch (type.kind) {
|
|
107232
107181
|
case "parameter":
|
|
107233
|
-
return type.
|
|
107182
|
+
return type.entity.getOriginalEntity() === typeParameterEntity.getOriginalEntity();
|
|
107234
107183
|
case "function": {
|
|
107235
107184
|
return type.getParameters().some((p) => this.typeContainsTypeParameter(p.getType(), typeParameterEntity)) || this.typeContainsTypeParameter(type.getReturnType(), typeParameterEntity);
|
|
107236
107185
|
}
|
|
107237
107186
|
case "structured": {
|
|
107238
|
-
const isNamed = isNamedTypeEntity(type.
|
|
107187
|
+
const isNamed = isNamedTypeEntity(type.entity);
|
|
107239
107188
|
if (isNamed) {
|
|
107240
|
-
return this.substitutionsContainTypeParameter(type.
|
|
107189
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
107241
107190
|
} else {
|
|
107242
107191
|
return false;
|
|
107243
107192
|
}
|
|
107244
107193
|
}
|
|
107245
107194
|
case "variant": {
|
|
107246
|
-
const isNamed = isNamedTypeEntity(type.
|
|
107195
|
+
const isNamed = isNamedTypeEntity(type.entity);
|
|
107247
107196
|
if (isNamed) {
|
|
107248
|
-
return this.substitutionsContainTypeParameter(type.
|
|
107197
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
107249
107198
|
} else {
|
|
107250
107199
|
return false;
|
|
107251
107200
|
}
|
|
107252
107201
|
}
|
|
107253
107202
|
case "alias":
|
|
107254
|
-
return this.substitutionsContainTypeParameter(type.
|
|
107203
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
107255
107204
|
case "reduced":
|
|
107256
|
-
return this.substitutionsContainTypeParameter(type.
|
|
107205
|
+
return this.substitutionsContainTypeParameter(type.substitutions, typeParameterEntity);
|
|
107257
107206
|
case "union":
|
|
107258
107207
|
return type.originalTypes.some((t) => this.typeContainsTypeParameter(t, typeParameterEntity));
|
|
107259
107208
|
case "intersection":
|
|
@@ -107627,7 +107576,7 @@ var OverloadResolver2 = class {
|
|
|
107627
107576
|
}
|
|
107628
107577
|
functionLiteralCouldBeAssignableToType(type) {
|
|
107629
107578
|
type = type.unalias();
|
|
107630
|
-
return type.
|
|
107579
|
+
return type.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.object || type.entity?.getOriginalEntity() === this.analyzer.originalWellKnownDeclarations.func || type.kind === "function" || type.kind === "union" && type.originalTypes.some((t) => this.functionLiteralCouldBeAssignableToType(t));
|
|
107631
107580
|
}
|
|
107632
107581
|
reportAmbiguousAccessDiagnostic(signatures) {
|
|
107633
107582
|
if (this.diagnostics !== void 0 && this.nodesForDiagnostic?.access !== void 0) {
|
|
@@ -107783,7 +107732,7 @@ var Resolver12 = class {
|
|
|
107783
107732
|
));
|
|
107784
107733
|
}
|
|
107785
107734
|
return ResolutionResult4.empty;
|
|
107786
|
-
} else if (singleTypeEntity.typeEntityKind === 1 /* Structured */ && singleTypeEntity.
|
|
107735
|
+
} else if (singleTypeEntity.typeEntityKind === 1 /* Structured */ && singleTypeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
107787
107736
|
if (diagnostics !== void 0 && diagnosticLocation !== void 0) {
|
|
107788
107737
|
diagnostics.addDiagnostic(analyzer.createDiagnostic(
|
|
107789
107738
|
2013 /* CannotCreateInstanceOfAspect */,
|
|
@@ -107911,7 +107860,7 @@ var Resolver12 = class {
|
|
|
107911
107860
|
case 5 /* Reduced */:
|
|
107912
107861
|
return true;
|
|
107913
107862
|
case 1 /* Structured */:
|
|
107914
|
-
return !(entity.
|
|
107863
|
+
return !(entity.structuredTypeKind === 2 /* Aspect */ || entity.isAbstract());
|
|
107915
107864
|
case 2 /* Parameter */:
|
|
107916
107865
|
return false;
|
|
107917
107866
|
default:
|
|
@@ -108030,7 +107979,7 @@ var Resolver13 = class {
|
|
|
108030
107979
|
);
|
|
108031
107980
|
return ResolutionResult5.unresolved();
|
|
108032
107981
|
}
|
|
108033
|
-
if (targetType.kind === "structured" && targetType.
|
|
107982
|
+
if (targetType.kind === "structured" && targetType.structuredTypeKind === 2 /* Aspect */) {
|
|
108034
107983
|
this.diagnostics?.addDiagnostic(
|
|
108035
107984
|
this.analyzer.createDiagnostic(2013 /* CannotCreateInstanceOfAspect */, this.node)
|
|
108036
107985
|
);
|
|
@@ -108245,7 +108194,7 @@ var FirstStageResolver3 = class {
|
|
|
108245
108194
|
}
|
|
108246
108195
|
const overriddenObjectMethod = this.analyzer.entity.ofMethodDeclaration(containingDeclaration).getOverriddenMembers().find((m) => {
|
|
108247
108196
|
const containingEntity = m.getEntity().getContainingEntity();
|
|
108248
|
-
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && (containingEntity.
|
|
108197
|
+
return containingEntity.kind === 2 /* Type */ && containingEntity.typeEntityKind === 1 /* Structured */ && (containingEntity.structuredTypeKind === 0 /* Class */ || containingEntity.structuredTypeKind === 1 /* Structure */) || containingEntity.kind === 6 /* TypeExtension */;
|
|
108249
108198
|
});
|
|
108250
108199
|
if (overriddenObjectMethod === void 0) {
|
|
108251
108200
|
this.diagnostics?.addDiagnostic(
|
|
@@ -108288,7 +108237,7 @@ var FirstStageResolver3 = class {
|
|
|
108288
108237
|
case 1 /* Structured */: {
|
|
108289
108238
|
const baseObjectType = typeEntity.getBaseObjectType();
|
|
108290
108239
|
let result = baseObjectType.cycleFree;
|
|
108291
|
-
if (result === void 0 && !isForBaseConstructorCall && typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.
|
|
108240
|
+
if (result === void 0 && !isForBaseConstructorCall && typeEntity.typeEntityKind === 1 /* Structured */ && typeEntity.structuredTypeKind === 2 /* Aspect */) {
|
|
108292
108241
|
result = this.analyzer.getLocalizedStandardTypes(typeEntity.getLocale()).object;
|
|
108293
108242
|
}
|
|
108294
108243
|
return result;
|
|
@@ -108817,7 +108766,7 @@ var DeclarationsUsageCounter2 = class {
|
|
|
108817
108766
|
this.recordUsage(meaning.packageAlias, void 0);
|
|
108818
108767
|
break;
|
|
108819
108768
|
case "type-access": {
|
|
108820
|
-
const entity = meaning.singleSuitableType?.
|
|
108769
|
+
const entity = meaning.singleSuitableType?.entity;
|
|
108821
108770
|
if (entity !== void 0) {
|
|
108822
108771
|
this.recordUsage(entity, void 0);
|
|
108823
108772
|
}
|
|
@@ -108852,7 +108801,7 @@ var DeclarationsUsageCounter2 = class {
|
|
|
108852
108801
|
entity = meaning.suitableOrSingleFunction?.getEntity();
|
|
108853
108802
|
break;
|
|
108854
108803
|
case "package-type-access":
|
|
108855
|
-
entity = meaning.singleSuitableType?.
|
|
108804
|
+
entity = meaning.singleSuitableType?.entity;
|
|
108856
108805
|
break;
|
|
108857
108806
|
case "type-access-at-constructor-call":
|
|
108858
108807
|
entity = meaning.callExpressionMeaning.typeEntity;
|
|
@@ -108886,7 +108835,7 @@ var DeclarationsUsageCounter2 = class {
|
|
|
108886
108835
|
}
|
|
108887
108836
|
case 10 /* NamedTypeSpecifier */: {
|
|
108888
108837
|
const resolved = this.analyzer.resolveNamedTypeSpecifier(node);
|
|
108889
|
-
const entity = resolved.type?.
|
|
108838
|
+
const entity = resolved.type?.entity;
|
|
108890
108839
|
if (entity !== void 0) {
|
|
108891
108840
|
this.recordUsage(entity, void 0);
|
|
108892
108841
|
}
|
|
@@ -111223,9 +111172,9 @@ var ReductionSourceMemberFinder2 = class _ReductionSourceMemberFinder {
|
|
|
111223
111172
|
const typeComparer = (t1, t2) => {
|
|
111224
111173
|
let result2 = t1.kind === "reduced" && t2.equals(reductionSource) && t1.getReductionSource().equals(reductionSource);
|
|
111225
111174
|
if (!result2) {
|
|
111226
|
-
result2 = t1.kind === t2.kind && t1.
|
|
111227
|
-
t1.
|
|
111228
|
-
t2.
|
|
111175
|
+
result2 = t1.kind === t2.kind && t1.entity?.getOriginalEntity() === t2.entity?.getOriginalEntity() && this.analyzer.typeUtils.compareSubstitutionsWithSimpleTypeComparer(
|
|
111176
|
+
t1.substitutions,
|
|
111177
|
+
t2.substitutions,
|
|
111229
111178
|
typeComparer
|
|
111230
111179
|
);
|
|
111231
111180
|
}
|
|
@@ -111832,20 +111781,20 @@ var Analyzer3 = class extends Analyzer {
|
|
|
111832
111781
|
} else {
|
|
111833
111782
|
const enumerableEntity = this.originalWellKnownDeclarations.enumerable;
|
|
111834
111783
|
let implementedEnumerableAspect;
|
|
111835
|
-
if (type.
|
|
111784
|
+
if (type.entity?.getOriginalEntity() === enumerableEntity) {
|
|
111836
111785
|
Debug.assert(type.kind === "structured");
|
|
111837
111786
|
implementedEnumerableAspect = type;
|
|
111838
111787
|
} else {
|
|
111839
|
-
implementedEnumerableAspect = Query.from(this.typeUtils.allAspectsOfType(type)).first((t) => t.
|
|
111788
|
+
implementedEnumerableAspect = Query.from(this.typeUtils.allAspectsOfType(type)).first((t) => t.entity.getOriginalEntity() === enumerableEntity);
|
|
111840
111789
|
}
|
|
111841
111790
|
if (implementedEnumerableAspect !== void 0) {
|
|
111842
111791
|
const parameter = enumerableEntity.getTypeParameters()[0];
|
|
111843
111792
|
Debug.assertNotNull(parameter, "\u0422\u0438\u043F \u041F\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043C\u044B\u0439 \u0434\u043E\u043B\u0436\u0435\u043D \u0438\u043C\u0435\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0442\u0438\u043F\u0430.");
|
|
111844
|
-
const elementType = implementedEnumerableAspect.
|
|
111793
|
+
const elementType = implementedEnumerableAspect.substitutions.map.get(parameter) ?? this.originalStandardTypes.unresolved;
|
|
111845
111794
|
result = new WithDiagnostics_ok(new ExpressionCanBeUsedInForLoopCheckResult2(elementType, void 0));
|
|
111846
111795
|
} else {
|
|
111847
111796
|
const semanticContext = this.semanticContext.containing(node);
|
|
111848
|
-
const typeLocale = type.
|
|
111797
|
+
const typeLocale = type.entity?.getLocale() ?? node.locale;
|
|
111849
111798
|
const enumeratorMethodName = LocalizationHelperA.localizeHelperPhrase(
|
|
111850
111799
|
8 /* EnumeratorMethodName */,
|
|
111851
111800
|
typeLocale
|
|
@@ -112706,7 +112655,7 @@ var Analyzer3 = class extends Analyzer {
|
|
|
112706
112655
|
}
|
|
112707
112656
|
createDefaultConstructors(typeEntity, fields) {
|
|
112708
112657
|
let result;
|
|
112709
|
-
const structuredTypeKind = typeEntity.
|
|
112658
|
+
const structuredTypeKind = typeEntity.structuredTypeKind;
|
|
112710
112659
|
if (structuredTypeKind === 0 /* Class */ || structuredTypeKind === 1 /* Structure */) {
|
|
112711
112660
|
const baseType = typeEntity.getBaseObjectType().cycleFree;
|
|
112712
112661
|
const variablesToInitialize = fields.filter((f) => !f.isStatic() && !isVariableEntityWithExplicitAccessors(f)).map((f) => {
|
|
@@ -113394,7 +113343,7 @@ var Type15 = class {
|
|
|
113394
113343
|
const targetArrayType = this.analyzer.getUnambiguousTargetArrayType(targetType);
|
|
113395
113344
|
const standardTypes = this.analyzer.getLocalizedStandardTypes(node.locale);
|
|
113396
113345
|
const elements = node.elementList.expressions.toArray();
|
|
113397
|
-
const arrayTypeEntity = standardTypes.array.
|
|
113346
|
+
const arrayTypeEntity = standardTypes.array.entity;
|
|
113398
113347
|
if (elements.length === 0) {
|
|
113399
113348
|
if (targetArrayType !== void 0) {
|
|
113400
113349
|
return targetArrayType;
|