Skip to content

Commit 30b7589

Browse files
committed
fix comments
1 parent 5383454 commit 30b7589

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Diff for: src/compiler/checker.ts

+11-14
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,16 @@ namespace ts {
172172
}
173173

174174
const enum CheckMode {
175-
Normal = 0, // Normal type checking
176-
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
177-
Inferential = 1 << 1, // Inferential typing
178-
SkipContextSensitive = 1 << 2, // Skip context sensitive function expressions
179-
SkipGenericFunctions = 1 << 3, // Skip single signature generic functions
180-
IsForSignatureHelp = 1 << 4, // Call resolution for purposes of signature help
181-
ObjectRestBindingElement = 1 << 5, // Checking a type that is going to be used to determine the type of a rest binding element
182-
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
183-
// we need to preserve generic types instead of substituting them for constraints
184-
IncludeOptionality = 1 << 6, // TODO: description, replace bool param with flag
175+
Normal = 0, // Normal type checking
176+
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
177+
Inferential = 1 << 1, // Inferential typing
178+
SkipContextSensitive = 1 << 2, // Skip context sensitive function expressions
179+
SkipGenericFunctions = 1 << 3, // Skip single signature generic functions
180+
IsForSignatureHelp = 1 << 4, // Call resolution for purposes of signature help
181+
ObjectRestBindingElement = 1 << 5, // Checking a type that is going to be used to determine the type of a rest binding element
182+
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
183+
// we need to preserve generic types instead of substituting them for constraints
184+
IncludeOptionality = 1 << 6, // >> TODO: description, replace bool param with flag
185185
}
186186

187187
const enum SignatureCheckMode {
@@ -24939,13 +24939,10 @@ namespace ts {
2493924939
return !!(type.flags & TypeFlags.Instantiable && !maybeTypeOfKind(getBaseConstraintOrType(type), TypeFlags.Nullable));
2494024940
}
2494124941

24942-
/**
24943-
* If check mode has `CheckMode.RestBindingElement`, we skip binding pattern contextual types.
24944-
*/
2494524942
function hasContextualTypeWithNoGenericTypes(node: Node, checkMode: CheckMode | undefined) {
2494624943
// Computing the contextual type for a child of a JSX element involves resolving the type of the
2494724944
// element's tag name, so we exclude that here to avoid circularities.
24948-
// If check mode has `CheckMode.RestBindingElement`, we skip binding pattern contextual types,
24945+
// If check mode has `CheckMode.ObjectRestBindingElement`, we skip binding pattern contextual types,
2494924946
// as we want the type of a rest element to be generic when possible.
2495024947
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) &&
2495124948
!((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&

0 commit comments

Comments
 (0)