File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,11 @@ def _merge_stubs_members(obj: Module | Class, stubs: Module | Class) -> None:
63
63
continue
64
64
obj_member = obj .get_member (member_name )
65
65
with suppress (AliasResolutionError , CyclicAliasError ):
66
- if obj_member .kind is not stub_member .kind :
66
+ # An object's canonical location can differ from its equivalent stub location.
67
+ # Devs usually declare stubs at the public location of the corresponding object,
68
+ # not the canonical one. Therefore, we must allow merging stubs into the target of an alias,
69
+ # as long as the stub and target are of the same kind.
70
+ if obj_member .kind is not stub_member .kind and not obj_member .is_alias :
67
71
logger .debug (
68
72
f"Cannot merge stubs for { obj_member .path } : kind { stub_member .kind .value } != { obj_member .kind .value } " ,
69
73
)
You can’t perform that action at this time.
0 commit comments