Skip to content

Commit f34585b

Browse files
howjmaygabritto
andauthored
fix the typos (microsoft#513)
Co-authored-by: Gabriela Araujo Britto <garaujobritto@gmail.com>
1 parent 2ea3ff0 commit f34585b

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

internal/checker/checker.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ type Checker struct {
552552
noImplicitThis bool
553553
useUnknownInCatchVariables bool
554554
exactOptionalPropertyTypes bool
555-
canCollectSymbolAliasAccessabilityData bool
555+
canCollectSymbolAliasAccessibilityData bool
556556
arrayVariances []VarianceFlags
557557
globals ast.SymbolTable
558558
globalSymbols []*ast.Symbol
@@ -828,7 +828,7 @@ func NewChecker(program Program) *Checker {
828828
c.noImplicitThis = c.getStrictOptionValue(c.compilerOptions.NoImplicitThis)
829829
c.useUnknownInCatchVariables = c.getStrictOptionValue(c.compilerOptions.UseUnknownInCatchVariables)
830830
c.exactOptionalPropertyTypes = c.compilerOptions.ExactOptionalPropertyTypes == core.TSTrue
831-
c.canCollectSymbolAliasAccessabilityData = c.compilerOptions.VerbatimModuleSyntax.IsFalseOrUnknown()
831+
c.canCollectSymbolAliasAccessibilityData = c.compilerOptions.VerbatimModuleSyntax.IsFalseOrUnknown()
832832
c.arrayVariances = []VarianceFlags{VarianceFlagsCovariant}
833833
c.globals = make(ast.SymbolTable, countGlobalSymbols(c.files))
834834
c.evaluate = createEvaluator(c.evaluateEntity)
@@ -9319,7 +9319,7 @@ func (c *Checker) invocationErrorDetails(errorTarget *ast.Node, apparentType *Ty
93199319
diagnostic = NewDiagnosticChainForNode(diagnostic, target, core.IfElse(isCall, diagnostics.Not_all_constituents_of_type_0_are_callable, diagnostics.Not_all_constituents_of_type_0_are_constructable), c.TypeToString(apparentType))
93209320
}
93219321
if hasSignatures {
9322-
// Bail early if we already found a siganture, no chance of "No constituent of type is callable"
9322+
// Bail early if we already found a signature, no chance of "No constituent of type is callable"
93239323
break
93249324
}
93259325
}
@@ -14064,7 +14064,7 @@ func (c *Checker) resolveExternalModule(location *ast.Node, moduleReference stri
1406414064
if ambientModule != nil {
1406514065
return ambientModule
1406614066
}
14067-
// !!! The following only implements simple module resoltion
14067+
// !!! The following only implements simple module resolution
1406814068
sourceFile := c.program.GetResolvedModule(ast.GetSourceFileOfNode(location), moduleReference)
1406914069
if sourceFile != nil {
1407014070
if sourceFile.Symbol != nil {
@@ -22315,7 +22315,7 @@ func (c *Checker) getConditionalType(root *ConditionalRoot, mapper *TypeMapper,
2231522315
// types rules (i.e. proper contravariance) for inferences.
2231622316
c.inferTypes(context.inferences, checkType, extendsType, InferencePriorityNoConstraints|InferencePriorityAlwaysStrict, false)
2231722317
}
22318-
// It's possible for 'infer T' type paramteters to be given uninstantiated constraints when the
22318+
// It's possible for 'infer T' type parameters to be given uninstantiated constraints when the
2231922319
// those type parameters are used in type references (see getInferredTypeParameterConstraint). For
2232022320
// that reason we need context.mapper to be first in the combined mapper. See #42636 for examples.
2232122321
if mapper != nil {
@@ -24857,7 +24857,7 @@ func (c *Checker) getIndexedAccessTypeOrUndefined(objectType *Type, indexType *T
2485724857
if propType != nil {
2485824858
propTypes = append(propTypes, propType)
2485924859
} else if accessNode == nil {
24860-
// If there's no error node, we can immeditely stop, since error reporting is off
24860+
// If there's no error node, we can immediately stop, since error reporting is off
2486124861
return nil
2486224862
} else {
2486324863
// Otherwise we set a flag and return at the end of the loop so we still mark all errors
@@ -25138,7 +25138,7 @@ func (c *Checker) isSelfTypeAccess(name *ast.Node, parent *ast.Symbol) bool {
2513825138

2513925139
func (c *Checker) isAssignmentToReadonlyEntity(expr *ast.Node, symbol *ast.Symbol, assignmentKind AssignmentKind) bool {
2514025140
if assignmentKind == AssignmentKindNone {
25141-
// no assigment means it doesn't matter whether the entity is readonly
25141+
// no assignment means it doesn't matter whether the entity is readonly
2514225142
return false
2514325143
}
2514425144
if c.isReadonlySymbol(symbol) {
@@ -25925,7 +25925,7 @@ func (c *Checker) transformTypeOfMembers(t *Type, f func(propertyType *Type) *Ty
2592525925
}
2592625926

2592725927
func (c *Checker) markLinkedReferences(location *ast.Node, hint ReferenceHint, propSymbol *ast.Symbol, parentType *Type) {
25928-
if !c.canCollectSymbolAliasAccessabilityData {
25928+
if !c.canCollectSymbolAliasAccessibilityData {
2592925929
return
2593025930
}
2593125931
if location.Flags&ast.NodeFlagsAmbient != 0 && !ast.IsPropertySignatureDeclaration(location) && !ast.IsPropertyDeclaration(location) {
@@ -26133,7 +26133,7 @@ func (c *Checker) markPropertyAliasReferenced(location *ast.Node /*PropertyAcces
2613326133
}
2613426134
}
2613526135

26136-
func (c *Checker) markExportAssignmentAliasReferenced(location *ast.Node /*ExportAssigment*/) {
26136+
func (c *Checker) markExportAssignmentAliasReferenced(location *ast.Node /*ExportAssignment*/) {
2613726137
id := location.Expression()
2613826138
if ast.IsIdentifier(id) {
2613926139
sym := c.getExportSymbolOfValueSymbolIfExported(c.resolveEntityName(id, ast.SymbolFlagsAll, true /*ignoreErrors*/, true /*dontResolveAlias*/, location))
@@ -26183,7 +26183,7 @@ func (c *Checker) markDecoratorAliasReferenced(node *ast.Node /*HasDecorators*/)
2618326183
}
2618426184

2618526185
func (c *Checker) markAliasReferenced(symbol *ast.Symbol, location *ast.Node) {
26186-
if !c.canCollectSymbolAliasAccessabilityData {
26186+
if !c.canCollectSymbolAliasAccessibilityData {
2618726187
return
2618826188
}
2618926189
if ast.IsNonLocalAlias(symbol, ast.SymbolFlagsValue /*excludes*/) && !isInTypeQuery(location) {
@@ -26247,7 +26247,7 @@ func (c *Checker) markEntityNameOrEntityExpressionAsReference(typeName *ast.Node
2624726247
rootSymbol := c.resolveName(rootName, rootName.Text(), meaning, nil /*nameNotFoundMessage*/, true /*isUse*/, false /*excludeGlobals*/)
2624826248

2624926249
if rootSymbol != nil && rootSymbol.Flags&ast.SymbolFlagsAlias != 0 {
26250-
if c.canCollectSymbolAliasAccessabilityData &&
26250+
if c.canCollectSymbolAliasAccessibilityData &&
2625126251
c.symbolIsValue(rootSymbol) &&
2625226252
!isConstEnumOrConstEnumOnlyModule(c.resolveAlias(rootSymbol)) &&
2625326253
c.getTypeOnlyAliasDeclaration(rootSymbol) == nil {

internal/checker/emitresolver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func isConstEnumOrConstEnumOnlyModule(s *ast.Symbol) bool {
2424

2525
func (r *emitResolver) IsReferencedAliasDeclaration(node *ast.Node) bool {
2626
c := r.checker
27-
if !c.canCollectSymbolAliasAccessabilityData || !ast.IsParseTreeNode(node) {
27+
if !c.canCollectSymbolAliasAccessibilityData || !ast.IsParseTreeNode(node) {
2828
return true
2929
}
3030

@@ -50,7 +50,7 @@ func (r *emitResolver) IsReferencedAliasDeclaration(node *ast.Node) bool {
5050

5151
func (r *emitResolver) IsValueAliasDeclaration(node *ast.Node) bool {
5252
c := r.checker
53-
if !c.canCollectSymbolAliasAccessabilityData || !ast.IsParseTreeNode(node) {
53+
if !c.canCollectSymbolAliasAccessibilityData || !ast.IsParseTreeNode(node) {
5454
return true
5555
}
5656

@@ -115,7 +115,7 @@ func (r *emitResolver) isAliasResolvedToValue(symbol *ast.Symbol, excludeTypeOnl
115115

116116
func (r *emitResolver) IsTopLevelValueImportEqualsWithEntityName(node *ast.Node) bool {
117117
c := r.checker
118-
if !c.canCollectSymbolAliasAccessabilityData {
118+
if !c.canCollectSymbolAliasAccessibilityData {
119119
return true
120120
}
121121
if !ast.IsParseTreeNode(node) || node.Kind != ast.KindImportEqualsDeclaration || node.Parent.Kind != ast.KindSourceFile {

internal/checker/inference.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ func (c *Checker) resolveReverseMappedTypeMembers(t *Type) {
10391039
if constraintTarget.flags&TypeFlagsIndexedAccess != 0 && constraintTarget.AsIndexedAccessType().objectType.flags&TypeFlagsTypeParameter != 0 && constraintTarget.AsIndexedAccessType().indexType.flags&TypeFlagsTypeParameter != 0 {
10401040
// A reverse mapping of `{[K in keyof T[K_1]]: T[K_1]}` is the same as that of `{[K in keyof T]: T}`, since all we care about is
10411041
// inferring to the "type parameter" (or indexed access) shared by the constraint and template. So, to reduce the number of
1042-
// type identities produced, we simplify such indexed access occurences
1042+
// type identities produced, we simplify such indexed access occurrences
10431043
newTypeParam := constraintTarget.AsIndexedAccessType().objectType
10441044
newMappedType := c.replaceIndexedAccess(r.mappedType, constraintTarget, newTypeParam)
10451045
links.mappedType = newMappedType

internal/checker/relater.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,7 @@ func (c *Checker) getEffectiveConstraintOfIntersection(types []*Type, targetIsUn
22972297
}
22982298

22992299
func (c *Checker) templateLiteralTypesDefinitelyUnrelated(source *TemplateLiteralType, target *TemplateLiteralType) bool {
2300-
// Two template literal types with diffences in their starting or ending text spans are definitely unrelated.
2300+
// Two template literal types with differences in their starting or ending text spans are definitely unrelated.
23012301
sourceStart := source.texts[0]
23022302
targetStart := target.texts[0]
23032303
sourceEnd := source.texts[len(source.texts)-1]
@@ -4728,7 +4728,7 @@ func (r *Relater) reportError(message *diagnostics.Message, args ...any) {
47284728
return
47294729
}
47304730
// Transform a property incompatibility message for property 'x' followed by some elaboration message
4731-
// followed by a signature return type incompatibility message into a single return type incompatiblity
4731+
// followed by a signature return type incompatibility message into a single return type incompatibility
47324732
// message for 'x()' or 'x(...)'
47334733
var arg string
47344734
switch r.getChainMessage(1) {

0 commit comments

Comments
 (0)