Fixed bug that resulted in incorrect type evaluation of a dictionary key when assigning a dictionary expression to a dict with a generic key type.

This commit is contained in:
Eric Traut 2022-05-03 23:06:07 -07:00
parent 33d68d3e33
commit a9b6311ac5

View File

@ -12054,16 +12054,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
isIncomplete = true;
}
let keyType = keyTypeResult.type;
if (expectedKeyType) {
const adjExpectedKeyType = makeTopLevelTypeVarsConcrete(expectedKeyType);
if (!isAnyOrUnknown(adjExpectedKeyType)) {
if (canAssignType(adjExpectedKeyType, keyType)) {
keyType = adjExpectedKeyType;
}
}
}
const keyType = keyTypeResult.type;
let valueTypeResult: TypeResult;
if (