diff --git a/internal/checker/checker.go b/internal/checker/checker.go index ec83d74faf..db6693beef 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -523,287 +523,287 @@ type Host interface{} var nextCheckerID atomic.Uint32 type Checker struct { - id uint32 - program Program - host Host - compilerOptions *core.CompilerOptions - files []*ast.SourceFile - fileIndexMap map[*ast.SourceFile]int - compareSymbols func(*ast.Symbol, *ast.Symbol) int - TypeCount uint32 - symbolCount uint32 - totalInstantiationCount uint32 - instantiationCount uint32 - instantiationDepth uint32 - inlineLevel int - currentNode *ast.Node - varianceTypeParameter *Type - languageVersion core.ScriptTarget - moduleKind core.ModuleKind - isInferencePartiallyBlocked bool - legacyDecorators bool - emitStandardClassFields bool - allowSyntheticDefaultImports bool - strictNullChecks bool - strictFunctionTypes bool - strictBindCallApply bool - strictPropertyInitialization bool - strictBuiltinIteratorReturn bool - noImplicitAny bool - noImplicitThis bool - useUnknownInCatchVariables bool - exactOptionalPropertyTypes bool - canCollectSymbolAliasAccessibilityData bool - arrayVariances []VarianceFlags - globals ast.SymbolTable - globalSymbols []*ast.Symbol - evaluate evaluator.Evaluator - stringLiteralTypes map[string]*Type - numberLiteralTypes map[jsnum.Number]*Type - bigintLiteralTypes map[jsnum.PseudoBigInt]*Type - enumLiteralTypes map[EnumLiteralKey]*Type - indexedAccessTypes map[string]*Type - templateLiteralTypes map[string]*Type - stringMappingTypes map[StringMappingKey]*Type - uniqueESSymbolTypes map[*ast.Symbol]*Type - subtypeReductionCache map[string][]*Type - cachedTypes map[CachedTypeKey]*Type - cachedSignatures map[CachedSignatureKey]*Signature - undefinedProperties map[string]*ast.Symbol - narrowedTypes map[NarrowedTypeKey]*Type - assignmentReducedTypes map[AssignmentReducedKey]*Type - discriminatedContextualTypes map[DiscriminatedContextualTypeKey]*Type - instantiationExpressionTypes map[InstantiationExpressionKey]*Type - substitutionTypes map[SubstitutionTypeKey]*Type - reverseMappedCache map[ReverseMappedTypeKey]*Type - reverseHomomorphicMappedCache map[ReverseMappedTypeKey]*Type - iterationTypesCache map[IterationTypesKey]IterationTypes - markerTypes core.Set[*Type] - identifierSymbols map[*ast.Node]*ast.Symbol - undefinedSymbol *ast.Symbol - argumentsSymbol *ast.Symbol - requireSymbol *ast.Symbol - unknownSymbol *ast.Symbol - resolvingSymbol *ast.Symbol - unresolvedSymbols map[string]*ast.Symbol - errorTypes map[string]*Type - globalThisSymbol *ast.Symbol - resolveName func(location *ast.Node, name string, meaning ast.SymbolFlags, nameNotFoundMessage *diagnostics.Message, isUse bool, excludeGlobals bool) *ast.Symbol - resolveNameForSymbolSuggestion func(location *ast.Node, name string, meaning ast.SymbolFlags, nameNotFoundMessage *diagnostics.Message, isUse bool, excludeGlobals bool) *ast.Symbol - tupleTypes map[string]*Type - unionTypes map[string]*Type - unionOfUnionTypes map[UnionOfUnionKey]*Type - intersectionTypes map[string]*Type - diagnostics ast.DiagnosticsCollection - suggestionDiagnostics ast.DiagnosticsCollection - symbolPool core.Pool[ast.Symbol] - signaturePool core.Pool[Signature] - indexInfoPool core.Pool[IndexInfo] - mergedSymbols map[*ast.Symbol]*ast.Symbol - factory ast.NodeFactory - nodeLinks core.LinkStore[*ast.Node, NodeLinks] - signatureLinks core.LinkStore[*ast.Node, SignatureLinks] - typeNodeLinks core.LinkStore[*ast.Node, TypeNodeLinks] - enumMemberLinks core.LinkStore[*ast.Node, EnumMemberLinks] - assertionLinks core.LinkStore[*ast.Node, AssertionLinks] - arrayLiteralLinks core.LinkStore[*ast.Node, ArrayLiteralLinks] - switchStatementLinks core.LinkStore[*ast.Node, SwitchStatementLinks] - symbolReferenceLinks core.LinkStore[*ast.Symbol, SymbolReferenceLinks] - valueSymbolLinks core.LinkStore[*ast.Symbol, ValueSymbolLinks] - mappedSymbolLinks core.LinkStore[*ast.Symbol, MappedSymbolLinks] - deferredSymbolLinks core.LinkStore[*ast.Symbol, DeferredSymbolLinks] - aliasSymbolLinks core.LinkStore[*ast.Symbol, AliasSymbolLinks] - moduleSymbolLinks core.LinkStore[*ast.Symbol, ModuleSymbolLinks] - lateBoundLinks core.LinkStore[*ast.Symbol, LateBoundLinks] - exportTypeLinks core.LinkStore[*ast.Symbol, ExportTypeLinks] - membersAndExportsLinks core.LinkStore[*ast.Symbol, MembersAndExportsLinks] - typeAliasLinks core.LinkStore[*ast.Symbol, TypeAliasLinks] - declaredTypeLinks core.LinkStore[*ast.Symbol, DeclaredTypeLinks] - spreadLinks core.LinkStore[*ast.Symbol, SpreadLinks] - varianceLinks core.LinkStore[*ast.Symbol, VarianceLinks] - indexSymbolLinks core.LinkStore[*ast.Symbol, IndexSymbolLinks] - ReverseMappedSymbolLinks core.LinkStore[*ast.Symbol, ReverseMappedSymbolLinks] - markedAssignmentSymbolLinks core.LinkStore[*ast.Symbol, MarkedAssignmentSymbolLinks] - sourceFileLinks core.LinkStore[*ast.SourceFile, SourceFileLinks] - patternForType map[*Type]*ast.Node - contextFreeTypes map[*ast.Node]*Type - anyType *Type - autoType *Type - wildcardType *Type - blockedStringType *Type - errorType *Type - unresolvedType *Type - nonInferrableAnyType *Type - intrinsicMarkerType *Type - unknownType *Type - undefinedType *Type - undefinedWideningType *Type - missingType *Type - undefinedOrMissingType *Type - optionalType *Type - nullType *Type - nullWideningType *Type - stringType *Type - numberType *Type - bigintType *Type - regularFalseType *Type - falseType *Type - regularTrueType *Type - trueType *Type - booleanType *Type - esSymbolType *Type - voidType *Type - neverType *Type - silentNeverType *Type - implicitNeverType *Type - unreachableNeverType *Type - nonPrimitiveType *Type - stringOrNumberType *Type - stringNumberSymbolType *Type - numberOrBigIntType *Type - templateConstraintType *Type - numericStringType *Type - uniqueLiteralType *Type - uniqueLiteralMapper *TypeMapper - reliabilityFlags RelationComparisonResult - reportUnreliableMapper *TypeMapper - reportUnmeasurableMapper *TypeMapper - restrictiveMapper *TypeMapper - permissiveMapper *TypeMapper - emptyObjectType *Type - emptyTypeLiteralType *Type - unknownEmptyObjectType *Type - unknownUnionType *Type - emptyGenericType *Type - anyFunctionType *Type - noConstraintType *Type - circularConstraintType *Type - resolvingDefaultType *Type - markerSuperType *Type - markerSubType *Type - markerOtherType *Type - markerSuperTypeForCheck *Type - markerSubTypeForCheck *Type - noTypePredicate *TypePredicate - anySignature *Signature - unknownSignature *Signature - resolvingSignature *Signature - silentNeverSignature *Signature - enumNumberIndexInfo *IndexInfo - patternAmbientModules []ast.PatternAmbientModule - patternAmbientModuleAugmentations ast.SymbolTable - globalObjectType *Type - globalFunctionType *Type - globalCallableFunctionType *Type - globalNewableFunctionType *Type - globalArrayType *Type - globalReadonlyArrayType *Type - globalStringType *Type - globalNumberType *Type - globalBooleanType *Type - globalRegExpType *Type - globalThisType *Type - anyArrayType *Type - autoArrayType *Type - anyReadonlyArrayType *Type - deferredGlobalImportMetaExpressionType *Type - contextualBindingPatterns []*ast.Node - emptyStringType *Type - zeroType *Type - zeroBigIntType *Type - typeofType *Type - typeResolutions []TypeResolution - resolutionStart int - inVarianceComputation bool - suggestionCount int - apparentArgumentCount *int - lastGetCombinedNodeFlagsNode *ast.Node - lastGetCombinedNodeFlagsResult ast.NodeFlags - lastGetCombinedModifierFlagsNode *ast.Node - lastGetCombinedModifierFlagsResult ast.ModifierFlags - inferenceStates []InferenceState - flowStates []FlowState - flowLoopCache map[FlowLoopKey]*Type - flowLoopStack []FlowLoopInfo - sharedFlows []SharedFlow - antecedentTypes []*Type - flowAnalysisDisabled bool - flowInvocationCount int - flowTypeCache map[*ast.Node]*Type - lastFlowNode *ast.FlowNode - lastFlowNodeReachable bool - flowNodeReachable map[*ast.FlowNode]bool - flowNodePostSuper map[*ast.FlowNode]bool - renamedBindingElementsInTypes []*ast.Node - contextualInfos []ContextualInfo - inferenceContextInfos []InferenceContextInfo - awaitedTypeStack []*Type - reverseMappedSourceStack []*Type - reverseMappedTargetStack []*Type - reverseExpandingFlags ExpandingFlags - relaters []Relater - subtypeRelation *Relation - strictSubtypeRelation *Relation - assignableRelation *Relation - comparableRelation *Relation - identityRelation *Relation - enumRelation map[EnumRelationKey]RelationComparisonResult - getGlobalESSymbolType func() *Type - getGlobalBigIntType func() *Type - getGlobalImportMetaType func() *Type - getGlobalImportAttributesType func() *Type - getGlobalImportAttributesTypeChecked func() *Type - getGlobalNonNullableTypeAliasOrNil func() *ast.Symbol - getGlobalExtractSymbol func() *ast.Symbol - getGlobalDisposableType func() *Type - getGlobalAsyncDisposableType func() *Type - getGlobalAwaitedSymbol func() *ast.Symbol - getGlobalAwaitedSymbolOrNil func() *ast.Symbol - getGlobalNaNSymbolOrNil func() *ast.Symbol - getGlobalRecordSymbol func() *ast.Symbol - getGlobalTemplateStringsArrayType func() *Type - getGlobalESSymbolConstructorSymbolOrNil func() *ast.Symbol - getGlobalImportCallOptionsType func() *Type - getGlobalImportCallOptionsTypeChecked func() *Type - getGlobalPromiseType func() *Type - getGlobalPromiseTypeChecked func() *Type - getGlobalPromiseLikeType func() *Type - getGlobalPromiseConstructorSymbol func() *ast.Symbol - getGlobalPromiseConstructorSymbolOrNil func() *ast.Symbol - getGlobalOmitSymbol func() *ast.Symbol - getGlobalIteratorType func() *Type - getGlobalIterableType func() *Type - getGlobalIterableTypeChecked func() *Type - getGlobalIterableIteratorType func() *Type - getGlobalIterableIteratorTypeChecked func() *Type - getGlobalIteratorObjectType func() *Type - getGlobalGeneratorType func() *Type - getGlobalAsyncIteratorType func() *Type - getGlobalAsyncIterableType func() *Type - getGlobalAsyncIterableIteratorType func() *Type - getGlobalAsyncIterableIteratorTypeChecked func() *Type - getGlobalAsyncIteratorObjectType func() *Type - getGlobalAsyncGeneratorType func() *Type - getGlobalIteratorYieldResultType func() *Type - getGlobalIteratorReturnResultType func() *Type - getGlobalTypedPropertyDescriptorType func() *Type - getGlobalClassDecoratorContextType func() *Type - getGlobalClassMethodDecoratorContextType func() *Type - getGlobalClassGetterDecoratorContextType func() *Type - getGlobalClassSetterDecoratorContextType func() *Type - getGlobalClassAccessorDecoratorContxtType func() *Type - getGlobalClassAccessorDecoratorTargetType func() *Type - getGlobalClassAccessorDecoratorResultType func() *Type - getGlobalClassFieldDecoratorContextType func() *Type - syncIterationTypesResolver *IterationTypesResolver - asyncIterationTypesResolver *IterationTypesResolver - isPrimitiveOrObjectOrEmptyType func(*Type) bool - containsMissingType func(*Type) bool - couldContainTypeVariables func(*Type) bool - isStringIndexSignatureOnlyType func(*Type) bool - markNodeAssignments func(*ast.Node) bool - emitResolver *emitResolver - emitResolverOnce sync.Once + id uint32 + program Program + host Host + compilerOptions *core.CompilerOptions + files []*ast.SourceFile + fileIndexMap map[*ast.SourceFile]int + compareSymbols func(*ast.Symbol, *ast.Symbol) int + TypeCount uint32 + symbolCount uint32 + totalInstantiationCount uint32 + instantiationCount uint32 + instantiationDepth uint32 + inlineLevel int + currentNode *ast.Node + varianceTypeParameter *Type + languageVersion core.ScriptTarget + moduleKind core.ModuleKind + isInferencePartiallyBlocked bool + legacyDecorators bool + emitStandardClassFields bool + allowSyntheticDefaultImports bool + strictNullChecks bool + strictFunctionTypes bool + strictBindCallApply bool + strictPropertyInitialization bool + strictBuiltinIteratorReturn bool + noImplicitAny bool + noImplicitThis bool + useUnknownInCatchVariables bool + exactOptionalPropertyTypes bool + canCollectSymbolAliasAccessibilityData bool + arrayVariances []VarianceFlags + globals ast.SymbolTable + globalSymbols []*ast.Symbol + evaluate evaluator.Evaluator + stringLiteralTypes map[string]*Type + numberLiteralTypes map[jsnum.Number]*Type + bigintLiteralTypes map[jsnum.PseudoBigInt]*Type + enumLiteralTypes map[EnumLiteralKey]*Type + indexedAccessTypes map[string]*Type + templateLiteralTypes map[string]*Type + stringMappingTypes map[StringMappingKey]*Type + uniqueESSymbolTypes map[*ast.Symbol]*Type + subtypeReductionCache map[string][]*Type + cachedTypes map[CachedTypeKey]*Type + cachedSignatures map[CachedSignatureKey]*Signature + undefinedProperties map[string]*ast.Symbol + narrowedTypes map[NarrowedTypeKey]*Type + assignmentReducedTypes map[AssignmentReducedKey]*Type + discriminatedContextualTypes map[DiscriminatedContextualTypeKey]*Type + instantiationExpressionTypes map[InstantiationExpressionKey]*Type + substitutionTypes map[SubstitutionTypeKey]*Type + reverseMappedCache map[ReverseMappedTypeKey]*Type + reverseHomomorphicMappedCache map[ReverseMappedTypeKey]*Type + iterationTypesCache map[IterationTypesKey]IterationTypes + markerTypes core.Set[*Type] + identifierSymbols map[*ast.Node]*ast.Symbol + undefinedSymbol *ast.Symbol + argumentsSymbol *ast.Symbol + requireSymbol *ast.Symbol + unknownSymbol *ast.Symbol + resolvingSymbol *ast.Symbol + unresolvedSymbols map[string]*ast.Symbol + errorTypes map[string]*Type + globalThisSymbol *ast.Symbol + resolveName func(location *ast.Node, name string, meaning ast.SymbolFlags, nameNotFoundMessage *diagnostics.Message, isUse bool, excludeGlobals bool) *ast.Symbol + resolveNameForSymbolSuggestion func(location *ast.Node, name string, meaning ast.SymbolFlags, nameNotFoundMessage *diagnostics.Message, isUse bool, excludeGlobals bool) *ast.Symbol + tupleTypes map[string]*Type + unionTypes map[string]*Type + unionOfUnionTypes map[UnionOfUnionKey]*Type + intersectionTypes map[string]*Type + diagnostics ast.DiagnosticsCollection + suggestionDiagnostics ast.DiagnosticsCollection + symbolPool core.Pool[ast.Symbol] + signaturePool core.Pool[Signature] + indexInfoPool core.Pool[IndexInfo] + mergedSymbols map[*ast.Symbol]*ast.Symbol + factory ast.NodeFactory + nodeLinks core.LinkStore[*ast.Node, NodeLinks] + signatureLinks core.LinkStore[*ast.Node, SignatureLinks] + typeNodeLinks core.LinkStore[*ast.Node, TypeNodeLinks] + enumMemberLinks core.LinkStore[*ast.Node, EnumMemberLinks] + assertionLinks core.LinkStore[*ast.Node, AssertionLinks] + arrayLiteralLinks core.LinkStore[*ast.Node, ArrayLiteralLinks] + switchStatementLinks core.LinkStore[*ast.Node, SwitchStatementLinks] + symbolReferenceLinks core.LinkStore[*ast.Symbol, SymbolReferenceLinks] + valueSymbolLinks core.LinkStore[*ast.Symbol, ValueSymbolLinks] + mappedSymbolLinks core.LinkStore[*ast.Symbol, MappedSymbolLinks] + deferredSymbolLinks core.LinkStore[*ast.Symbol, DeferredSymbolLinks] + aliasSymbolLinks core.LinkStore[*ast.Symbol, AliasSymbolLinks] + moduleSymbolLinks core.LinkStore[*ast.Symbol, ModuleSymbolLinks] + lateBoundLinks core.LinkStore[*ast.Symbol, LateBoundLinks] + exportTypeLinks core.LinkStore[*ast.Symbol, ExportTypeLinks] + membersAndExportsLinks core.LinkStore[*ast.Symbol, MembersAndExportsLinks] + typeAliasLinks core.LinkStore[*ast.Symbol, TypeAliasLinks] + declaredTypeLinks core.LinkStore[*ast.Symbol, DeclaredTypeLinks] + spreadLinks core.LinkStore[*ast.Symbol, SpreadLinks] + varianceLinks core.LinkStore[*ast.Symbol, VarianceLinks] + indexSymbolLinks core.LinkStore[*ast.Symbol, IndexSymbolLinks] + ReverseMappedSymbolLinks core.LinkStore[*ast.Symbol, ReverseMappedSymbolLinks] + markedAssignmentSymbolLinks core.LinkStore[*ast.Symbol, MarkedAssignmentSymbolLinks] + sourceFileLinks core.LinkStore[*ast.SourceFile, SourceFileLinks] + patternForType map[*Type]*ast.Node + contextFreeTypes map[*ast.Node]*Type + anyType *Type + autoType *Type + wildcardType *Type + blockedStringType *Type + errorType *Type + unresolvedType *Type + nonInferrableAnyType *Type + intrinsicMarkerType *Type + unknownType *Type + undefinedType *Type + undefinedWideningType *Type + missingType *Type + undefinedOrMissingType *Type + optionalType *Type + nullType *Type + nullWideningType *Type + stringType *Type + numberType *Type + bigintType *Type + regularFalseType *Type + falseType *Type + regularTrueType *Type + trueType *Type + booleanType *Type + esSymbolType *Type + voidType *Type + neverType *Type + silentNeverType *Type + implicitNeverType *Type + unreachableNeverType *Type + nonPrimitiveType *Type + stringOrNumberType *Type + stringNumberSymbolType *Type + numberOrBigIntType *Type + templateConstraintType *Type + numericStringType *Type + uniqueLiteralType *Type + uniqueLiteralMapper *TypeMapper + reliabilityFlags RelationComparisonResult + reportUnreliableMapper *TypeMapper + reportUnmeasurableMapper *TypeMapper + restrictiveMapper *TypeMapper + permissiveMapper *TypeMapper + emptyObjectType *Type + emptyTypeLiteralType *Type + unknownEmptyObjectType *Type + unknownUnionType *Type + emptyGenericType *Type + anyFunctionType *Type + noConstraintType *Type + circularConstraintType *Type + resolvingDefaultType *Type + markerSuperType *Type + markerSubType *Type + markerOtherType *Type + markerSuperTypeForCheck *Type + markerSubTypeForCheck *Type + noTypePredicate *TypePredicate + anySignature *Signature + unknownSignature *Signature + resolvingSignature *Signature + silentNeverSignature *Signature + enumNumberIndexInfo *IndexInfo + patternAmbientModules []ast.PatternAmbientModule + patternAmbientModuleAugmentations ast.SymbolTable + globalObjectType *Type + globalFunctionType *Type + globalCallableFunctionType *Type + globalNewableFunctionType *Type + globalArrayType *Type + globalReadonlyArrayType *Type + globalStringType *Type + globalNumberType *Type + globalBooleanType *Type + globalRegExpType *Type + globalThisType *Type + anyArrayType *Type + autoArrayType *Type + anyReadonlyArrayType *Type + deferredGlobalImportMetaExpressionType *Type + contextualBindingPatterns []*ast.Node + emptyStringType *Type + zeroType *Type + zeroBigIntType *Type + typeofType *Type + typeResolutions []TypeResolution + resolutionStart int + inVarianceComputation bool + suggestionCount int + apparentArgumentCount *int + lastGetCombinedNodeFlagsNode *ast.Node + lastGetCombinedNodeFlagsResult ast.NodeFlags + lastGetCombinedModifierFlagsNode *ast.Node + lastGetCombinedModifierFlagsResult ast.ModifierFlags + inferenceStates []InferenceState + flowStates []FlowState + flowLoopCache map[FlowLoopKey]*Type + flowLoopStack []FlowLoopInfo + sharedFlows []SharedFlow + antecedentTypes []*Type + flowAnalysisDisabled bool + flowInvocationCount int + flowTypeCache map[*ast.Node]*Type + lastFlowNode *ast.FlowNode + lastFlowNodeReachable bool + flowNodeReachable map[*ast.FlowNode]bool + flowNodePostSuper map[*ast.FlowNode]bool + renamedBindingElementsInTypes []*ast.Node + contextualInfos []ContextualInfo + inferenceContextInfos []InferenceContextInfo + awaitedTypeStack []*Type + reverseMappedSourceStack []*Type + reverseMappedTargetStack []*Type + reverseExpandingFlags ExpandingFlags + relaters []Relater + subtypeRelation *Relation + strictSubtypeRelation *Relation + assignableRelation *Relation + comparableRelation *Relation + identityRelation *Relation + enumRelation map[EnumRelationKey]RelationComparisonResult + getGlobalESSymbolType func() *Type + getGlobalBigIntType func() *Type + getGlobalImportMetaType func() *Type + getGlobalImportAttributesType func() *Type + getGlobalImportAttributesTypeChecked func() *Type + getGlobalNonNullableTypeAliasOrNil func() *ast.Symbol + getGlobalExtractSymbol func() *ast.Symbol + getGlobalDisposableType func() *Type + getGlobalAsyncDisposableType func() *Type + getGlobalAwaitedSymbol func() *ast.Symbol + getGlobalAwaitedSymbolOrNil func() *ast.Symbol + getGlobalNaNSymbolOrNil func() *ast.Symbol + getGlobalRecordSymbol func() *ast.Symbol + getGlobalTemplateStringsArrayType func() *Type + getGlobalESSymbolConstructorSymbolOrNil func() *ast.Symbol + getGlobalImportCallOptionsType func() *Type + getGlobalImportCallOptionsTypeChecked func() *Type + getGlobalPromiseType func() *Type + getGlobalPromiseTypeChecked func() *Type + getGlobalPromiseLikeType func() *Type + getGlobalPromiseConstructorSymbol func() *ast.Symbol + getGlobalPromiseConstructorSymbolOrNil func() *ast.Symbol + getGlobalOmitSymbol func() *ast.Symbol + getGlobalIteratorType func() *Type + getGlobalIterableType func() *Type + getGlobalIterableTypeChecked func() *Type + getGlobalIterableIteratorType func() *Type + getGlobalIterableIteratorTypeChecked func() *Type + getGlobalIteratorObjectType func() *Type + getGlobalGeneratorType func() *Type + getGlobalAsyncIteratorType func() *Type + getGlobalAsyncIterableType func() *Type + getGlobalAsyncIterableIteratorType func() *Type + getGlobalAsyncIterableIteratorTypeChecked func() *Type + getGlobalAsyncIteratorObjectType func() *Type + getGlobalAsyncGeneratorType func() *Type + getGlobalIteratorYieldResultType func() *Type + getGlobalIteratorReturnResultType func() *Type + getGlobalTypedPropertyDescriptorType func() *Type + getGlobalClassDecoratorContextType func() *Type + getGlobalClassMethodDecoratorContextType func() *Type + getGlobalClassGetterDecoratorContextType func() *Type + getGlobalClassSetterDecoratorContextType func() *Type + getGlobalClassAccessorDecoratorContextType func() *Type + getGlobalClassAccessorDecoratorTargetType func() *Type + getGlobalClassAccessorDecoratorResultType func() *Type + getGlobalClassFieldDecoratorContextType func() *Type + syncIterationTypesResolver *IterationTypesResolver + asyncIterationTypesResolver *IterationTypesResolver + isPrimitiveOrObjectOrEmptyType func(*Type) bool + containsMissingType func(*Type) bool + couldContainTypeVariables func(*Type) bool + isStringIndexSignatureOnlyType func(*Type) bool + markNodeAssignments func(*ast.Node) bool + emitResolver *emitResolver + emitResolverOnce sync.Once } func NewChecker(program Program) *Checker { @@ -1001,7 +1001,7 @@ func NewChecker(program Program) *Checker { c.getGlobalClassMethodDecoratorContextType = c.getGlobalTypeResolver("ClassMethodDecoratorContext", 2 /*arity*/, true /*reportErrors*/) c.getGlobalClassGetterDecoratorContextType = c.getGlobalTypeResolver("ClassGetterDecoratorContext", 2 /*arity*/, true /*reportErrors*/) c.getGlobalClassSetterDecoratorContextType = c.getGlobalTypeResolver("ClassSetterDecoratorContext", 2 /*arity*/, true /*reportErrors*/) - c.getGlobalClassAccessorDecoratorContxtType = c.getGlobalTypeResolver("ClassAccessorDecoratorContext", 2 /*arity*/, true /*reportErrors*/) + c.getGlobalClassAccessorDecoratorContextType = c.getGlobalTypeResolver("ClassAccessorDecoratorContext", 2 /*arity*/, true /*reportErrors*/) c.getGlobalClassAccessorDecoratorTargetType = c.getGlobalTypeResolver("ClassAccessorDecoratorTarget", 2 /*arity*/, true /*reportErrors*/) c.getGlobalClassAccessorDecoratorResultType = c.getGlobalTypeResolver("ClassAccessorDecoratorResult", 2 /*arity*/, true /*reportErrors*/) c.getGlobalClassFieldDecoratorContextType = c.getGlobalTypeResolver("ClassFieldDecoratorContext", 2 /*arity*/, true /*reportErrors*/) @@ -5525,7 +5525,7 @@ func (c *Checker) checkVarDeclaredNamesNotShadowed(node *ast.Node) { namesShareScope := container != nil && (ast.IsBlock(container) && ast.IsFunctionLike(container.Parent) || ast.IsModuleBlock(container) || ast.IsModuleDeclaration(container) || ast.IsSourceFile(container)) // here we know that function scoped variable is "shadowed" by block scoped one - // a var declatation can't hoist past a lexical declaration and it results in a SyntaxError at runtime + // a var declaration can't hoist past a lexical declaration and it results in a SyntaxError at runtime if !namesShareScope { name := c.symbolToString(localDeclarationSymbol) c.error(node, diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name) @@ -20210,7 +20210,7 @@ func isReservedMemberName(name string) bool { } func (c *Checker) symbolIsValue(symbol *ast.Symbol) bool { - return c.symbolIsValueEx(symbol, false /*includeTyoeOnlyMembers*/) + return c.symbolIsValueEx(symbol, false /*includeTypeOnlyMembers*/) } func (c *Checker) symbolIsValueEx(symbol *ast.Symbol, includeTypeOnlyMembers bool) bool { @@ -20357,7 +20357,7 @@ func (c *Checker) instantiateTypeWorker(t *Type, m *TypeMapper, alias *TypeAlias return t } -// Handles instantion of the following object types: +// Handles instantiation of the following object types: // AnonymousType (ObjectFlagsAnonymous) // TypeReference with node != nil (ObjectFlagsReference) // SingleSignatureType (ObjectFlagsSingleSignatureType) @@ -27739,7 +27739,7 @@ func (c *Checker) newClassSetterDecoratorContextType(classType *Type, valueType } func (c *Checker) newClassAccessorDecoratorContextType(thisType *Type, valueType *Type) *Type { - return c.tryCreateTypeReference(c.getGlobalClassAccessorDecoratorContxtType(), []*Type{thisType, valueType}) + return c.tryCreateTypeReference(c.getGlobalClassAccessorDecoratorContextType(), []*Type{thisType, valueType}) } func (c *Checker) newClassFieldDecoratorContextType(thisType *Type, valueType *Type) *Type { @@ -28487,7 +28487,7 @@ func (c *Checker) removeNullableByIntersection(t *Type, targetFacts TypeFacts, o // By default we intersect with a union of {} and the opposite nullable. emptyAndOtherUnion := c.getUnionType([]*Type{c.emptyObjectType, otherType}) // For each constituent type that can compare equal to the target nullable, intersect with the above union - // if the type doesn't already include the opppsite nullable and the constituent can compare equal to the + // if the type doesn't already include the opposite nullable and the constituent can compare equal to the // opposite nullable; otherwise, just intersect with {}. return c.mapType(t, func(t *Type) *Type { if c.hasTypeFacts(t, targetFacts) { diff --git a/internal/execute/tsc.go b/internal/execute/tsc.go index 6dc1126397..09bbf05f86 100644 --- a/internal/execute/tsc.go +++ b/internal/execute/tsc.go @@ -77,14 +77,14 @@ func executeCommandLineWorker(sys System, cb cbType, commandLine *tsoptions.Pars return ExitStatusDiagnosticsPresent_OutputsSkipped, nil } - // !!! convert to options with absolute paths is usualy done here, but for ease of implementation, it's done in `tsoptions.ParseCommandLine()` + // !!! convert to options with absolute paths is usually done here, but for ease of implementation, it's done in `tsoptions.ParseCommandLine()` compilerOptionsFromCommandLine := commandLine.CompilerOptions() if configFileName != "" { extendedConfigCache := map[tspath.Path]*tsoptions.ExtendedConfigCacheEntry{} configParseResult, errors := getParsedCommandLineOfConfigFile(configFileName, compilerOptionsFromCommandLine, sys, extendedConfigCache) if len(errors) != 0 { - // these are unrecoverable errors--exit to report them as diagnotics + // these are unrecoverable errors--exit to report them as diagnostics for _, e := range errors { reportDiagnostic(e) } @@ -144,7 +144,7 @@ func getParsedCommandLineOfConfigFile(configFileName string, options *core.Compi errors := []*ast.Diagnostic{} configFileText, errors := tsoptions.TryReadFile(configFileName, sys.FS().ReadFile, errors) if len(errors) > 0 { - // these are unrecoverable errors--exit to report them as diagnotics + // these are unrecoverable errors--exit to report them as diagnostics return nil, errors } diff --git a/internal/vfs/osvfs/os.go b/internal/vfs/osvfs/os.go index b10a3ded16..2bfc61ef04 100644 --- a/internal/vfs/osvfs/os.go +++ b/internal/vfs/osvfs/os.go @@ -49,7 +49,7 @@ var isFileSystemCaseSensitive = func() bool { panic(fmt.Sprintf("vfs: failed to get executable path: %v", err)) } - // If the current executable exists under a different case, we must be case-insensitve. + // If the current executable exists under a different case, we must be case-insensitive. swapped := swapCase(exe) if _, err := os.Stat(swapped); err != nil { if os.IsNotExist(err) {