mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
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:
parent
33d68d3e33
commit
a9b6311ac5
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user