Skip to content

Commit

Permalink
Improved consistency of parameter ordering internally to type evaluat…
Browse files Browse the repository at this point in the history
…or. No functional change.
  • Loading branch information
msfterictraut committed Jun 18, 2023
1 parent 9bf8231 commit 53cb3f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/pyright-internal/src/analyzer/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ export function validateBinaryOperation(
export function getTypeOfBinaryOperation(
evaluator: TypeEvaluator,
node: BinaryOperationNode,
inferenceContext: InferenceContext | undefined,
flags: EvaluatorFlags
flags: EvaluatorFlags,
inferenceContext: InferenceContext | undefined
): TypeResult {
const leftExpression = node.leftExpression;
let rightExpression = node.rightExpression;
Expand All @@ -505,7 +505,7 @@ export function getTypeOfBinaryOperation(
operatorSupportsChaining(rightExpression.operator)
) {
// Evaluate the right expression so it is type checked.
getTypeOfBinaryOperation(evaluator, rightExpression, inferenceContext, flags);
getTypeOfBinaryOperation(evaluator, rightExpression, flags, inferenceContext);

// Use the left side of the right expression for comparison purposes.
rightExpression = rightExpression.leftExpression;
Expand Down
14 changes: 7 additions & 7 deletions packages/pyright-internal/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,12 +955,12 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
}

case ParseNodeType.Call: {
typeResult = getTypeOfCall(node, inferenceContext, flags);
typeResult = getTypeOfCall(node, flags, inferenceContext);
break;
}

case ParseNodeType.Tuple: {
typeResult = getTypeOfTuple(node, inferenceContext, flags);
typeResult = getTypeOfTuple(node, flags, inferenceContext);
break;
}

Expand Down Expand Up @@ -999,7 +999,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
}

case ParseNodeType.BinaryOperation: {
typeResult = getTypeOfBinaryOperation(evaluatorInterface, node, inferenceContext, flags);
typeResult = getTypeOfBinaryOperation(evaluatorInterface, node, flags, inferenceContext);
break;
}

Expand Down Expand Up @@ -7372,8 +7372,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions

function getTypeOfTuple(
node: TupleNode,
inferenceContext: InferenceContext | undefined,
flags: EvaluatorFlags
flags: EvaluatorFlags,
inferenceContext: InferenceContext | undefined
): TypeResult {
if ((flags & EvaluatorFlags.ExpectingType) !== 0 && node.expressions.length === 0 && !inferenceContext) {
return { type: makeTupleObject([]), isEmptyTupleShorthand: true };
Expand Down Expand Up @@ -7590,8 +7590,8 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions

function getTypeOfCall(
node: CallNode,
inferenceContext: InferenceContext | undefined,
flags: EvaluatorFlags
flags: EvaluatorFlags,
inferenceContext: InferenceContext | undefined
): TypeResult {
let baseTypeResult: TypeResult | undefined;

Expand Down

0 comments on commit 53cb3f9

Please sign in to comment.