Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions packages/pyright-internal/src/analyzer/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function createProperty(

// Fill in the fget method.
propertyObject.priv.fgetInfo = {
methodType: FunctionType.cloneWithNewFlags(fget, fget.shared.flags | FunctionTypeFlags.StaticMethod),
methodType: fget,
classType: fget.shared.methodClass,
};

Expand Down Expand Up @@ -194,7 +194,7 @@ export function clonePropertyWithSetter(

// Fill in the new fset method.
propertyObject.priv.fsetInfo = {
methodType: FunctionType.cloneWithNewFlags(fset, fset.shared.flags | FunctionTypeFlags.StaticMethod),
methodType: fset,
classType: fset.shared.methodClass,
};

Expand Down Expand Up @@ -253,7 +253,7 @@ export function clonePropertyWithDeleter(

// Fill in the fdel method.
propertyObject.priv.fdelInfo = {
methodType: FunctionType.cloneWithNewFlags(fdel, fdel.shared.flags | FunctionTypeFlags.StaticMethod),
methodType: fdel,
classType: fdel.shared.methodClass,
};

Expand Down Expand Up @@ -504,7 +504,7 @@ export function assignProperty(
let destAccessType = accessorInfo.getFunction(destPropertyType);

if (destAccessType && isFunction(destAccessType)) {
let srcAccessType = accessorInfo.getFunction(srcPropertyType);
const srcAccessType = accessorInfo.getFunction(srcPropertyType);

if (!srcAccessType || !isFunction(srcAccessType)) {
diag?.addMessage(accessorInfo.missingDiagMsg());
Expand All @@ -521,20 +521,6 @@ export function assignProperty(
destAccessType = applySolvedTypeVars(destAccessType, selfSolution) as FunctionType;
}

// The access methods of fget, fset and fdel are modeled as static
// variables because they do not bind go the "property" class that
// contains them, but we'll turn it back into a non-static method
// here and bind them to the associated objects.
destAccessType = FunctionType.cloneWithNewFlags(
destAccessType,
destAccessType.shared.flags & ~FunctionTypeFlags.StaticMethod
);

srcAccessType = FunctionType.cloneWithNewFlags(
srcAccessType,
srcAccessType.shared.flags & ~FunctionTypeFlags.StaticMethod
);

const boundDestAccessType = evaluator.bindFunctionToClassOrObject(
destObjectToBind,
destAccessType,
Expand Down
Loading