Skip to content

Commit 4dce1de

Browse files
committed
revert some of the minor changes
1 parent 17fa1c4 commit 4dce1de

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31996,7 +31996,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3199631996
// If no inferences have been made, and none of the type parameters for which we are inferring
3199731997
// specify default types, nothing is gained from instantiating as type parameters would just be
3199831998
// replaced with their constraints similar to the apparent type.
31999-
if (inferenceContext && (contextFlags! & ContextFlags.ContextualSignature || isReturnExpressionLiteralContext(node)) && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
31999+
if (inferenceContext && (contextFlags! & ContextFlags.Signature || isReturnExpressionLiteralContext(node)) && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
3200032000
// For contextual signatures we incorporate all inferences made so far, e.g. from return
3200132001
// types as well as arguments to the left in a function call.
3200232002
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
@@ -32463,7 +32463,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3246332463
if (typeTagSignature) {
3246432464
return typeTagSignature;
3246532465
}
32466-
const type = getApparentTypeOfContextualType(node, ContextFlags.ContextualSignature);
32466+
const type = getApparentTypeOfContextualType(node, ContextFlags.Signature);
3246732467
if (!type) {
3246832468
return undefined;
3246932469
}
@@ -40718,7 +40718,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4071840718
(isPropertyAssignment(parent) || isShorthandPropertyAssignment(parent) || isTemplateSpan(parent)) && isConstContext(parent.parent);
4071940719
}
4072040720

40721-
function checkExpressionForMutableLocation(node: Expression, checkMode?: CheckMode, forceTuple?: boolean): Type {
40721+
function checkExpressionForMutableLocation(node: Expression, checkMode: CheckMode | undefined, forceTuple?: boolean): Type {
4072240722
const type = checkExpression(node, checkMode, forceTuple);
4072340723
return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
4072440724
isTypeAssertion(node) ? type :

src/compiler/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5461,10 +5461,10 @@ export const enum IntersectionFlags {
54615461
// dprint-ignore
54625462
/** @internal */
54635463
export const enum ContextFlags {
5464-
None = 0,
5465-
ContextualSignature = 1 << 0, // Obtaining contextual signature or checking its return type
5466-
NoConstraints = 1 << 1, // Don't obtain type variable constraints
5467-
Completions = 1 << 2, // Ignore inference to current node and parent nodes out to the containing call for completions
5464+
None = 0,
5465+
Signature = 1 << 0, // Obtaining contextual signature
5466+
NoConstraints = 1 << 1, // Don't obtain type variable constraints
5467+
Completions = 1 << 2, // Ignore inference to current node and parent nodes out to the containing call for completions
54685468
SkipBindingPatterns = 1 << 3, // Ignore contextual types applied by binding patterns
54695469
}
54705470

0 commit comments

Comments
 (0)