diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 770e1a7c1c60a..fdc09cd8b8640 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5338,9 +5338,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function createIntrinsicType(kind: TypeFlags, intrinsicName: string, objectFlags = ObjectFlags.None, debugIntrinsicName?: string): IntrinsicType { checkIntrinsicName(intrinsicName, debugIntrinsicName); - const type = createType(kind) as IntrinsicType; - type.intrinsicName = intrinsicName; - type.debugIntrinsicName = debugIntrinsicName; + const type = createType(kind) as TypeWithData; + type.data.intrinsicName = intrinsicName; + type.data.debugIntrinsicName = debugIntrinsicName; type.objectFlags = objectFlags | ObjectFlags.CouldContainTypeVariablesComputed | ObjectFlags.IsGenericTypeComputed | ObjectFlags.IsUnknownLikeUnionComputed | ObjectFlags.IsNeverIntersectionComputed; return type; } @@ -5352,15 +5352,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } seenIntrinsicNames.add(key); } - + type TypeWithData = T & { data: Omit; }; function createObjectType(objectFlags: ObjectFlags, symbol?: Symbol): ObjectType { - const type = createTypeWithSymbol(TypeFlags.Object, symbol!) as ObjectType; + const type = createTypeWithSymbol(TypeFlags.Object, symbol!) as TypeWithData; type.objectFlags = objectFlags; - type.members = undefined; - type.properties = undefined; - type.callSignatures = undefined; - type.constructSignatures = undefined; - type.indexInfos = undefined; + type.data.members = undefined; + type.data.properties = undefined; + type.data.callSignatures = undefined; + type.data.constructSignatures = undefined; + type.data.indexInfos = undefined; return type; } @@ -5405,14 +5405,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function setStructuredTypeMembers(type: StructuredType, members: SymbolTable, callSignatures: readonly Signature[], constructSignatures: readonly Signature[], indexInfos: readonly IndexInfo[]): ResolvedType { - const resolved = type as ResolvedType; - resolved.members = members; - resolved.properties = emptyArray; - resolved.callSignatures = callSignatures; - resolved.constructSignatures = constructSignatures; - resolved.indexInfos = indexInfos; + const resolved = type as TypeWithData; + resolved.data.members = members; + resolved.data.properties = emptyArray; + resolved.data.callSignatures = callSignatures; + resolved.data.constructSignatures = constructSignatures; + resolved.data.indexInfos = indexInfos; // This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized. - if (members !== emptySymbols) resolved.properties = getNamedMembers(members); + if (members !== emptySymbols) resolved.data.properties = getNamedMembers(members); return resolved; } @@ -13022,13 +13022,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return links.declaredType; } - function createComputedEnumType(symbol: Symbol) { - const regularType = createTypeWithSymbol(TypeFlags.Enum, symbol) as EnumType; - const freshType = createTypeWithSymbol(TypeFlags.Enum, symbol) as EnumType; - regularType.regularType = regularType; - regularType.freshType = freshType; - freshType.regularType = regularType; - freshType.freshType = freshType; + function createComputedEnumType(symbol: Symbol): EnumType { + const regularType = createTypeWithSymbol(TypeFlags.Enum, symbol) as TypeWithData; + const freshType = createTypeWithSymbol(TypeFlags.Enum, symbol) as TypeWithData; + regularType.data.regularType = regularType; + regularType.data.freshType = freshType; + freshType.data.regularType = regularType; + freshType.data.freshType = freshType; return regularType; } @@ -16261,22 +16261,22 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function createTypeReference(target: GenericType, typeArguments: readonly Type[] | undefined): TypeReference { const id = getTypeListId(typeArguments); - let type = target.instantiations.get(id); + let type = target.instantiations.get(id) as TypeWithData; if (!type) { - type = createObjectType(ObjectFlags.Reference, target.symbol) as TypeReference; + type = createObjectType(ObjectFlags.Reference, target.symbol) as TypeWithData; target.instantiations.set(id, type); type.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments) : 0; - type.target = target; - type.resolvedTypeArguments = typeArguments; + type.data.target = target; + type.data.resolvedTypeArguments = typeArguments; } return type; } function cloneTypeReference(source: TypeReference): TypeReference { - const type = createTypeWithSymbol(source.flags, source.symbol) as TypeReference; + const type = createTypeWithSymbol(source.flags, source.symbol) as TypeWithData; type.objectFlags = source.objectFlags; - type.target = source.target; - type.resolvedTypeArguments = source.resolvedTypeArguments; + type.data.target = source.target; + type.data.resolvedTypeArguments = source.resolvedTypeArguments; return type; } @@ -16286,12 +16286,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); aliasTypeArguments = mapper ? instantiateTypes(localAliasTypeArguments, mapper) : localAliasTypeArguments; } - const type = createObjectType(ObjectFlags.Reference, target.symbol) as DeferredTypeReference; - type.target = target; - type.node = node; - type.mapper = mapper; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; + const type = createObjectType(ObjectFlags.Reference, target.symbol) as TypeWithData; + type.data.target = target; + type.data.node = node; + type.data.mapper = mapper; + type.data.aliasSymbol = aliasSymbol; + type.data.aliasTypeArguments = aliasTypeArguments; return type; } @@ -17209,28 +17209,28 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { lengthSymbol.links.type = getUnionType(literalTypes); } properties.push(lengthSymbol); - const type = createObjectType(ObjectFlags.Tuple | ObjectFlags.Reference) as TupleType & InterfaceTypeWithDeclaredMembers; - type.typeParameters = typeParameters; - type.outerTypeParameters = undefined; - type.localTypeParameters = typeParameters; - type.instantiations = new Map(); - type.instantiations.set(getTypeListId(type.typeParameters), type as GenericType); - type.target = type as GenericType; - type.resolvedTypeArguments = type.typeParameters; - type.thisType = createTypeParameter(); - type.thisType.isThisType = true; - type.thisType.constraint = type; - type.declaredProperties = properties; - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredIndexInfos = emptyArray; - type.elementFlags = elementFlags; - type.minLength = minLength; - type.fixedLength = fixedLength; - type.hasRestElement = !!(combinedFlags & ElementFlags.Variable); - type.combinedFlags = combinedFlags; - type.readonly = readonly; - type.labeledElementDeclarations = namedMemberDeclarations; + const type = createObjectType(ObjectFlags.Tuple | ObjectFlags.Reference) as TypeWithData; + type.data.typeParameters = typeParameters; + type.data.outerTypeParameters = undefined; + type.data.localTypeParameters = typeParameters; + type.data.instantiations = new Map(); + type.data.instantiations.set(getTypeListId(type.typeParameters), type as GenericType); + type.data.target = type as GenericType; + type.data.resolvedTypeArguments = type.typeParameters; + type.data.thisType = createTypeParameter(); + type.data.thisType.isThisType = true; + type.data.thisType.constraint = type; + type.data.declaredProperties = properties; + type.data.declaredCallSignatures = emptyArray; + type.data.declaredConstructSignatures = emptyArray; + type.data.declaredIndexInfos = emptyArray; + type.data.elementFlags = elementFlags; + type.data.minLength = minLength; + type.data.fixedLength = fixedLength; + type.data.hasRestElement = !!(combinedFlags & ElementFlags.Variable); + type.data.combinedFlags = combinedFlags; + type.data.readonly = readonly; + type.data.labeledElementDeclarations = namedMemberDeclarations; return type; } @@ -17942,12 +17942,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return true; } - function createIntersectionType(types: Type[], objectFlags: ObjectFlags, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]) { - const result = createType(TypeFlags.Intersection) as IntersectionType; + function createIntersectionType(types: Type[], objectFlags: ObjectFlags, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): IntersectionType { + const result = createType(TypeFlags.Intersection) as TypeWithData; result.objectFlags = objectFlags | getPropagatingFlagsOfTypes(types, /*excludeKinds*/ TypeFlags.Nullable); - result.types = types; - result.aliasSymbol = aliasSymbol; - result.aliasTypeArguments = aliasTypeArguments; + result.data.types = types; + result.data.aliasSymbol = aliasSymbol; + result.data.aliasTypeArguments = aliasTypeArguments; return result; } @@ -18160,16 +18160,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return links.resolvedType; } - function createIndexType(type: InstantiableType | UnionOrIntersectionType, indexFlags: IndexFlags) { - const result = createType(TypeFlags.Index) as IndexType; - result.type = type; - result.indexFlags = indexFlags; + function createIndexType(type: InstantiableType | UnionOrIntersectionType, indexFlags: IndexFlags): IndexType { + const result = createType(TypeFlags.Index) as TypeWithData; + result.data.type = type; + result.data.indexFlags = indexFlags; return result; } - function createOriginIndexType(type: InstantiableType | UnionOrIntersectionType) { - const result = createOriginType(TypeFlags.Index) as IndexType; - result.type = type; + function createOriginIndexType(type: InstantiableType | UnionOrIntersectionType): IndexType { + const result = createOriginType(TypeFlags.Index) as TypeWithData; + result.data.type = type; return result; } @@ -18430,10 +18430,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { undefined; } - function createTemplateLiteralType(texts: readonly string[], types: readonly Type[]) { - const type = createType(TypeFlags.TemplateLiteral) as TemplateLiteralType; - type.texts = texts; - type.types = types; + function createTemplateLiteralType(texts: readonly string[], types: readonly Type[]): TemplateLiteralType { + const type = createType(TypeFlags.TemplateLiteral) as TypeWithData; + type.data.texts = texts; + type.data.types = types; return type; } @@ -18486,19 +18486,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return result; } - function createStringMappingType(symbol: Symbol, type: Type) { - const result = createTypeWithSymbol(TypeFlags.StringMapping, symbol) as StringMappingType; - result.type = type; + function createStringMappingType(symbol: Symbol, type: Type): StringMappingType { + const result = createTypeWithSymbol(TypeFlags.StringMapping, symbol) as TypeWithData; + result.data.type = type; return result; } - function createIndexedAccessType(objectType: Type, indexType: Type, accessFlags: AccessFlags, aliasSymbol: Symbol | undefined, aliasTypeArguments: readonly Type[] | undefined) { - const type = createType(TypeFlags.IndexedAccess) as IndexedAccessType; + function createIndexedAccessType(objectType: Type, indexType: Type, accessFlags: AccessFlags, aliasSymbol: Symbol | undefined, aliasTypeArguments: readonly Type[] | undefined): IndexedAccessType { + const type = createType(TypeFlags.IndexedAccess) as TypeWithData; type.objectType = objectType; - type.indexType = indexType; - type.accessFlags = accessFlags; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; + type.data.indexType = indexType; + type.data.accessFlags = accessFlags; + type.data.aliasSymbol = aliasSymbol; + type.data.aliasTypeArguments = aliasTypeArguments; return type; } @@ -19585,10 +19585,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info; } - function createLiteralType(flags: TypeFlags, value: string | number | PseudoBigInt, symbol?: Symbol, regularType?: LiteralType) { - const type = createTypeWithSymbol(flags, symbol!) as LiteralType; - type.value = value; - type.regularType = regularType || type; + function createLiteralType(flags: TypeFlags, value: string | number | PseudoBigInt, symbol?: Symbol, regularType?: LiteralType): LiteralType { + const type = createTypeWithSymbol(flags, symbol!) as TypeWithData; + type.data.value = value; + type.data.regularType = regularType || type; return type; } @@ -19652,9 +19652,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return links.resolvedType; } - function createUniqueESSymbolType(symbol: Symbol) { - const type = createTypeWithSymbol(TypeFlags.UniqueESSymbol, symbol) as UniqueESSymbolType; - type.escapedName = `__@${type.symbol.escapedName}@${getSymbolId(type.symbol)}` as __String; + function createUniqueESSymbolType(symbol: Symbol): UniqueESSymbolType { + const type = createTypeWithSymbol(TypeFlags.UniqueESSymbol, symbol) as TypeWithData; + type.data.escapedName = `__@${type.symbol.escapedName}@${getSymbolId(type.symbol)}` as __String; return type; } @@ -25698,10 +25698,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } // For all other object types we infer a new object type where the reverse mapping has been // applied to the type of each property. - const reversed = createObjectType(ObjectFlags.ReverseMapped | ObjectFlags.Anonymous, /*symbol*/ undefined) as ReverseMappedType; - reversed.source = source; - reversed.mappedType = target; - reversed.constraintType = constraint; + const reversed = createObjectType(ObjectFlags.ReverseMapped | ObjectFlags.Anonymous, /*symbol*/ undefined) as TypeWithData; + reversed.data.source = source; + reversed.data.mappedType = target; + reversed.data.constraintType = constraint; return reversed; } @@ -27824,8 +27824,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // array types are ultimately converted into manifest array types (using getFinalArrayType) // and never escape the getFlowTypeOfReference function. function createEvolvingArrayType(elementType: Type): EvolvingArrayType { - const result = createObjectType(ObjectFlags.EvolvingArray) as EvolvingArrayType; - result.elementType = elementType; + const result = createObjectType(ObjectFlags.EvolvingArray) as TypeWithData; + result.data.elementType = elementType; return result; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 1b972e990f7fb..00a21d04b593b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -8201,11 +8201,759 @@ function Symbol(this: Symbol, flags: SymbolFlags, name: __String) { (this as any).links = undefined; // used by TransientSymbol } -function Type(this: Type, checker: TypeChecker, flags: TypeFlags) { - // Note: if modifying this, be sure to update TypeObject in src/services/services.ts - this.flags = flags; - if (Debug.isDebugging || tracing) { - this.checker = checker; +class TypeDataImpl { +} + +// export const allTypes: TypeImpl[] = []; +/** @internal */ +export class TypeImpl { + checker!: TypeChecker; + flags: TypeFlags; + symbol: Symbol; + data: any; + id: number; + objectFlags: number; + constructor(checker: TypeChecker, flags: TypeFlags) { + this.id = 0; + if (Debug.isDebugging || tracing) { + this.checker = checker; + } + this.flags = flags; + this.objectFlags = 0; + this.symbol = undefined!; + this.data = new TypeDataImpl(); + // allTypes.push(this); + } + + get pattern() { + return this.data.pattern; + } + set pattern(value: any) { + this.data.pattern = value; + } + + get aliasSymbol() { + return this.data.aliasSymbol; + } + set aliasSymbol(value: any) { + this.data.aliasSymbol = value; + } + + get aliasTypeArguments() { + return this.data.aliasTypeArguments; + } + set aliasTypeArguments(value: any) { + this.data.aliasTypeArguments = value; + } + + get permissiveInstantiation() { + return this.data.permissiveInstantiation; + } + set permissiveInstantiation(value: any) { + this.data.permissiveInstantiation = value; + } + + get restrictiveInstantiation() { + return this.data.restrictiveInstantiation; + } + set restrictiveInstantiation(value: any) { + this.data.restrictiveInstantiation = value; + } + + get immediateBaseConstraint() { + return this.data.immediateBaseConstraint; + } + set immediateBaseConstraint(value: any) { + this.data.immediateBaseConstraint = value; + } + + get widened() { + return this.data.widened; + } + set widened(value: any) { + this.data.widened = value; + } + + get intrinsicName() { + return this.data.intrinsicName; + } + set intrinsicName(value: any) { + this.data.intrinsicName = value; + } + + get debugIntrinsicName() { + return this.data.debugIntrinsicName; + } + set debugIntrinsicName(value: any) { + this.data.debugIntrinsicName = value; + } + + // get objectFlags() { return this.data.objectFlags; } + // set objectFlags(value: any) { this.data.objectFlags = value } + + get freshType() { + return this.data.freshType; + } + set freshType(value: any) { + this.data.freshType = value; + } + + get regularType() { + return this.data.regularType; + } + set regularType(value: any) { + this.data.regularType = value; + } + + get value() { + return this.data.value; + } + set value(value: any) { + this.data.value = value; + } + + get escapedName() { + return this.data.escapedName; + } + set escapedName(value: any) { + this.data.escapedName = value; + } + + get members() { + return this.data.members; + } + set members(value: any) { + this.data.members = value; + } + + get properties() { + return this.data.properties; + } + set properties(value: any) { + this.data.properties = value; + } + + get callSignatures() { + return this.data.callSignatures; + } + set callSignatures(value: any) { + this.data.callSignatures = value; + } + + get constructSignatures() { + return this.data.constructSignatures; + } + set constructSignatures(value: any) { + this.data.constructSignatures = value; + } + + get indexInfos() { + return this.data.indexInfos; + } + set indexInfos(value: any) { + this.data.indexInfos = value; + } + + get objectTypeWithoutAbstractConstructSignatures() { + return this.data.objectTypeWithoutAbstractConstructSignatures; + } + set objectTypeWithoutAbstractConstructSignatures(value: any) { + this.data.objectTypeWithoutAbstractConstructSignatures = value; + } + + get typeParameters() { + return this.data.typeParameters; + } + set typeParameters(value: any) { + this.data.typeParameters = value; + } + + get outerTypeParameters() { + return this.data.outerTypeParameters; + } + set outerTypeParameters(value: any) { + this.data.outerTypeParameters = value; + } + + get localTypeParameters() { + return this.data.localTypeParameters; + } + set localTypeParameters(value: any) { + this.data.localTypeParameters = value; + } + + get thisType() { + return this.data.thisType; + } + set thisType(value: any) { + this.data.thisType = value; + } + + get resolvedBaseConstructorType() { + return this.data.resolvedBaseConstructorType; + } + set resolvedBaseConstructorType(value: any) { + this.data.resolvedBaseConstructorType = value; + } + + get resolvedBaseTypes() { + return this.data.resolvedBaseTypes; + } + set resolvedBaseTypes(value: any) { + this.data.resolvedBaseTypes = value; + } + + get baseTypesResolved() { + return this.data.baseTypesResolved; + } + set baseTypesResolved(value: any) { + this.data.baseTypesResolved = value; + } + + get declaredProperties() { + return this.data.declaredProperties; + } + set declaredProperties(value: any) { + this.data.declaredProperties = value; + } + + get declaredCallSignatures() { + return this.data.declaredCallSignatures; + } + set declaredCallSignatures(value: any) { + this.data.declaredCallSignatures = value; + } + + get declaredConstructSignatures() { + return this.data.declaredConstructSignatures; + } + set declaredConstructSignatures(value: any) { + this.data.declaredConstructSignatures = value; + } + + get declaredIndexInfos() { + return this.data.declaredIndexInfos; + } + set declaredIndexInfos(value: any) { + this.data.declaredIndexInfos = value; + } + + get instantiations() { + return this.data.instantiations; + } + set instantiations(value: any) { + this.data.instantiations = value; + } + + get variances() { + return this.data.variances; + } + set variances(value: any) { + this.data.variances = value; + } + + get target() { + return this.data.target; + } + set target(value: any) { + this.data.target = value; + } + + get node() { + return this.data.node; + } + set node(value: any) { + this.data.node = value; + } + + get mapper() { + return this.data.mapper; + } + set mapper(value: any) { + this.data.mapper = value; + } + + get resolvedTypeArguments() { + return this.data.resolvedTypeArguments; + } + set resolvedTypeArguments(value: any) { + this.data.resolvedTypeArguments = value; + } + + get literalType() { + return this.data.literalType; + } + set literalType(value: any) { + this.data.literalType = value; + } + + get cachedEquivalentBaseType() { + return this.data.cachedEquivalentBaseType; + } + set cachedEquivalentBaseType(value: any) { + this.data.cachedEquivalentBaseType = value; + } + + get elementFlags() { + return this.data.elementFlags; + } + set elementFlags(value: any) { + this.data.elementFlags = value; + } + + get minLength() { + return this.data.minLength; + } + set minLength(value: any) { + this.data.minLength = value; + } + + get fixedLength() { + return this.data.fixedLength; + } + set fixedLength(value: any) { + this.data.fixedLength = value; + } + + get hasRestElement() { + return this.data.hasRestElement; + } + set hasRestElement(value: any) { + this.data.hasRestElement = value; + } + + get combinedFlags() { + return this.data.combinedFlags; + } + set combinedFlags(value: any) { + this.data.combinedFlags = value; + } + + get readonly() { + return this.data.readonly; + } + set readonly(value: any) { + this.data.readonly = value; + } + + get labeledElementDeclarations() { + return this.data.labeledElementDeclarations; + } + set labeledElementDeclarations(value: any) { + this.data.labeledElementDeclarations = value; + } + + get declaration() { + return this.data.declaration; + } + set declaration(value: any) { + this.data.declaration = value; + } + + get typeParameter() { + return this.data.typeParameter; + } + set typeParameter(value: any) { + this.data.typeParameter = value; + } + + get constraintType() { + return this.data.constraintType; + } + set constraintType(value: any) { + this.data.constraintType = value; + } + + get nameType() { + return this.data.nameType; + } + set nameType(value: any) { + this.data.nameType = value; + } + + get templateType() { + return this.data.templateType; + } + set templateType(value: any) { + this.data.templateType = value; + } + + get modifiersType() { + return this.data.modifiersType; + } + set modifiersType(value: any) { + this.data.modifiersType = value; + } + + get resolvedApparentType() { + return this.data.resolvedApparentType; + } + set resolvedApparentType(value: any) { + this.data.resolvedApparentType = value; + } + + get containsError() { + return this.data.containsError; + } + set containsError(value: any) { + this.data.containsError = value; + } + + get elementType() { + return this.data.elementType; + } + set elementType(value: any) { + this.data.elementType = value; + } + + get finalArrayType() { + return this.data.finalArrayType; + } + set finalArrayType(value: any) { + this.data.finalArrayType = value; + } + + get source() { + return this.data.source; + } + set source(value: any) { + this.data.source = value; + } + + get mappedType() { + return this.data.mappedType; + } + set mappedType(value: any) { + this.data.mappedType = value; + } + + get types() { + return this.data.types; + } + set types(value: any) { + this.data.types = value; + } + + get propertyCache() { + return this.data.propertyCache; + } + set propertyCache(value: any) { + this.data.propertyCache = value; + } + + get propertyCacheWithoutObjectFunctionPropertyAugment() { + return this.data.propertyCacheWithoutObjectFunctionPropertyAugment; + } + set propertyCacheWithoutObjectFunctionPropertyAugment(value: any) { + this.data.propertyCacheWithoutObjectFunctionPropertyAugment = value; + } + + get resolvedProperties() { + return this.data.resolvedProperties; + } + set resolvedProperties(value: any) { + this.data.resolvedProperties = value; + } + + get resolvedIndexType() { + return this.data.resolvedIndexType; + } + set resolvedIndexType(value: any) { + this.data.resolvedIndexType = value; + } + + get resolvedStringIndexType() { + return this.data.resolvedStringIndexType; + } + set resolvedStringIndexType(value: any) { + this.data.resolvedStringIndexType = value; + } + + get resolvedBaseConstraint() { + return this.data.resolvedBaseConstraint; + } + set resolvedBaseConstraint(value: any) { + this.data.resolvedBaseConstraint = value; + } + + get iterationTypesOfGeneratorReturnType() { + return this.data.iterationTypesOfGeneratorReturnType; + } + set iterationTypesOfGeneratorReturnType(value: any) { + this.data.iterationTypesOfGeneratorReturnType = value; + } + + get iterationTypesOfAsyncGeneratorReturnType() { + return this.data.iterationTypesOfAsyncGeneratorReturnType; + } + set iterationTypesOfAsyncGeneratorReturnType(value: any) { + this.data.iterationTypesOfAsyncGeneratorReturnType = value; + } + + get iterationTypesOfIterable() { + return this.data.iterationTypesOfIterable; + } + set iterationTypesOfIterable(value: any) { + this.data.iterationTypesOfIterable = value; + } + + get iterationTypesOfIterator() { + return this.data.iterationTypesOfIterator; + } + set iterationTypesOfIterator(value: any) { + this.data.iterationTypesOfIterator = value; + } + + get iterationTypesOfAsyncIterable() { + return this.data.iterationTypesOfAsyncIterable; + } + set iterationTypesOfAsyncIterable(value: any) { + this.data.iterationTypesOfAsyncIterable = value; + } + + get iterationTypesOfAsyncIterator() { + return this.data.iterationTypesOfAsyncIterator; + } + set iterationTypesOfAsyncIterator(value: any) { + this.data.iterationTypesOfAsyncIterator = value; + } + + get iterationTypesOfIteratorResult() { + return this.data.iterationTypesOfIteratorResult; + } + set iterationTypesOfIteratorResult(value: any) { + this.data.iterationTypesOfIteratorResult = value; + } + + get resolvedReducedType() { + return this.data.resolvedReducedType; + } + set resolvedReducedType(value: any) { + this.data.resolvedReducedType = value; + } + + get origin() { + return this.data.origin; + } + set origin(value: any) { + this.data.origin = value; + } + + get keyPropertyName() { + return this.data.keyPropertyName; + } + set keyPropertyName(value: any) { + this.data.keyPropertyName = value; + } + + get constituentMap() { + return this.data.constituentMap; + } + set constituentMap(value: any) { + this.data.constituentMap = value; + } + + get arrayFallbackSignatures() { + return this.data.arrayFallbackSignatures; + } + set arrayFallbackSignatures(value: any) { + this.data.arrayFallbackSignatures = value; + } + + get promiseTypeOfPromiseConstructor() { + return this.data.promiseTypeOfPromiseConstructor; + } + set promiseTypeOfPromiseConstructor(value: any) { + this.data.promiseTypeOfPromiseConstructor = value; + } + + get promisedTypeOfPromise() { + return this.data.promisedTypeOfPromise; + } + set promisedTypeOfPromise(value: any) { + this.data.promisedTypeOfPromise = value; + } + + get awaitedTypeOfType() { + return this.data.awaitedTypeOfType; + } + set awaitedTypeOfType(value: any) { + this.data.awaitedTypeOfType = value; + } + + get uniqueLiteralFilledInstantiation() { + return this.data.uniqueLiteralFilledInstantiation; + } + set uniqueLiteralFilledInstantiation(value: any) { + this.data.uniqueLiteralFilledInstantiation = value; + } + + get syntheticType() { + return this.data.syntheticType; + } + set syntheticType(value: any) { + this.data.syntheticType = value; + } + + get defaultOnlyType() { + return this.data.defaultOnlyType; + } + set defaultOnlyType(value: any) { + this.data.defaultOnlyType = value; + } + + get constraint() { + return this.data.constraint; + } + set constraint(value: any) { + this.data.constraint = value; + } + + get default() { + return this.data.default; + } + set default(value: any) { + this.data.default = value; + } + + get isThisType() { + return this.data.isThisType; + } + set isThisType(value: any) { + this.data.isThisType = value; + } + + get resolvedDefaultType() { + return this.data.resolvedDefaultType; + } + set resolvedDefaultType(value: any) { + this.data.resolvedDefaultType = value; + } + + get objectType() { + return this.data.objectType; + } + set objectType(value: any) { + this.data.objectType = value; + } + + get indexType() { + return this.data.indexType; + } + set indexType(value: any) { + this.data.indexType = value; + } + + get accessFlags() { + return this.data.accessFlags; + } + set accessFlags(value: any) { + this.data.accessFlags = value; + } + + get simplifiedForReading() { + return this.data.simplifiedForReading; + } + set simplifiedForReading(value: any) { + this.data.simplifiedForReading = value; + } + + get simplifiedForWriting() { + return this.data.simplifiedForWriting; + } + set simplifiedForWriting(value: any) { + this.data.simplifiedForWriting = value; + } + + get type() { + return this.data.type; + } + set type(value: any) { + this.data.type = value; + } + + get indexFlags() { + return this.data.indexFlags; + } + set indexFlags(value: any) { + this.data.indexFlags = value; + } + + get root() { + return this.data.root; + } + set root(value: any) { + this.data.root = value; + } + + get checkType() { + return this.data.checkType; + } + set checkType(value: any) { + this.data.checkType = value; + } + + get extendsType() { + return this.data.extendsType; + } + set extendsType(value: any) { + this.data.extendsType = value; + } + + get resolvedTrueType() { + return this.data.resolvedTrueType; + } + set resolvedTrueType(value: any) { + this.data.resolvedTrueType = value; + } + + get resolvedFalseType() { + return this.data.resolvedFalseType; + } + set resolvedFalseType(value: any) { + this.data.resolvedFalseType = value; + } + + get resolvedInferredTrueType() { + return this.data.resolvedInferredTrueType; + } + set resolvedInferredTrueType(value: any) { + this.data.resolvedInferredTrueType = value; + } + + get resolvedDefaultConstraint() { + return this.data.resolvedDefaultConstraint; + } + set resolvedDefaultConstraint(value: any) { + this.data.resolvedDefaultConstraint = value; + } + + get resolvedConstraintOfDistributive() { + return this.data.resolvedConstraintOfDistributive; + } + set resolvedConstraintOfDistributive(value: any) { + this.data.resolvedConstraintOfDistributive = value; + } + + get combinedMapper() { + return this.data.combinedMapper; + } + set combinedMapper(value: any) { + this.data.combinedMapper = value; + } + + get texts() { + return this.data.texts; + } + set texts(value: any) { + this.data.texts = value; + } + + get baseType() { + return this.data.baseType; + } + set baseType(value: any) { + this.data.baseType = value; } } @@ -8271,7 +9019,7 @@ export const objectAllocator: ObjectAllocator = { getPrivateIdentifierConstructor: () => Node as any, getSourceFileConstructor: () => Node as any, getSymbolConstructor: () => Symbol as any, - getTypeConstructor: () => Type as any, + getTypeConstructor: () => TypeImpl as any, getSignatureConstructor: () => Signature as any, getSourceMapSourceConstructor: () => SourceMapSource as any, }; diff --git a/src/services/services.ts b/src/services/services.ts index 101fcebc91a99..c4660a67872a2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -335,6 +335,7 @@ import { Type, TypeChecker, TypeFlags, + TypeImpl, TypeNode, TypeParameter, TypePredicate, @@ -829,15 +830,9 @@ class PrivateIdentifierObject extends TokenOrIdentifierObject