mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed bug that resulted in the incorrect synthesis of __dataclass_fields__
for named tuples. This addresses #8152.
This commit is contained in:
parent
5f47007df3
commit
48a03076a3
@ -659,10 +659,13 @@ export function synthesizeDataClassMethods(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
symbolTable.set(
|
|
||||||
'__dataclass_fields__',
|
if (!isNamedTuple) {
|
||||||
Symbol.createWithType(SymbolFlags.ClassMember | SymbolFlags.ClassVar, dictType)
|
symbolTable.set(
|
||||||
);
|
'__dataclass_fields__',
|
||||||
|
Symbol.createWithType(SymbolFlags.ClassMember | SymbolFlags.ClassVar, dictType)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (ClassType.isDataClassGenerateSlots(classType) && classType.details.localSlotsNames === undefined) {
|
if (ClassType.isDataClassGenerateSlots(classType) && classType.details.localSlotsNames === undefined) {
|
||||||
classType.details.localSlotsNames = localDataClassEntries.map((entry) => entry.name);
|
classType.details.localSlotsNames = localDataClassEntries.map((entry) => entry.name);
|
||||||
|
Loading…
Reference in New Issue
Block a user