Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that leads to a false positive error in the `reportIncomp… #5300

Closed
wants to merge 1 commit into from

Conversation

erictraut
Copy link
Collaborator

…atibleMethodOverridecheck when a child class is overriding an overloaded method in the base class and one or more of the overloads doesn't apply because theselforcls` parameter is explicitly annotated in a way that's not applicable to the child class. This addresses #5288.

…atibleMethodOverride` check when a child class is overriding an overloaded method in the base class and one or more of the overloads doesn't apply because the `self` or `cls` parameter is explicitly annotated in a way that's not applicable to the child class. This addresses #5288.
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
+       "Type[Message[UserT@Message]]" is incompatible with "Type[ChatMessage[AuthorT@ChatMessage, MemberT@ChatMessage]]"
+       Type "Type[Message[UserT@Message]]" cannot be assigned to type "Type[ChatMessage[AuthorT@ChatMessage, MemberT@ChatMessage]]"
-           Type "AuthorT@ChatMessage" cannot be assigned to type "UserT@Message" (reportIncompatibleMethodOverride)
+     ... (reportIncompatibleMethodOverride)
-     Parameter "id" is missing in override (reportIncompatibleMethodOverride)
+     Parameter "id" is missing in override
+       "Type[ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]]" is incompatible with "Type[Clan]"
+       Type "Type[ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]]" cannot be assigned to type "Type[Clan]" (reportIncompatibleMethodOverride)
-     Parameter "**kwargs" has no corresponding parameter (reportIncompatibleMethodOverride)
+     Parameter "**kwargs" has no corresponding parameter
+       "_IOMixin" is incompatible with "ManifestPath" (reportIncompatibleMethodOverride)
-     Parameter "**kwargs" has no corresponding parameter (reportIncompatibleMethodOverride)
+     Parameter "**kwargs" has no corresponding parameter
+       "_IOMixin" is incompatible with "ManifestPath" (reportIncompatibleMethodOverride)
+       "Type[Message[UserT@Message]]" is incompatible with "Type[UserMessage[UserMessageAuthorT@UserMessage]]"
+       Type "Type[Message[UserT@Message]]" cannot be assigned to type "Type[UserMessage[UserMessageAuthorT@UserMessage]]"
-     Parameter "**kwargs" has no corresponding parameter (reportIncompatibleMethodOverride)
+     Parameter "**kwargs" has no corresponding parameter
+       "_IOMixin" is incompatible with "Award" (reportIncompatibleMethodOverride)
+       "collections.ChainMap" is incompatible with "steam.utils.ChainMap"
+       "dict[_KT@dict, _VT@dict]" is incompatible with "ConverterDict"
+       "Mapping[_KT@Mapping, _VT_co@Mapping]" is incompatible with "CaseInsensitiveDict[_VT@CaseInsensitiveDict]"
-     Positional parameter count mismatch; base method has 4, but override has 2 (reportIncompatibleMethodOverride)
+     Positional parameter count mismatch; base method has 4, but override has 2
+       "GCMessage" is incompatible with "CraftResponse" (reportIncompatibleMethodOverride)
-     Positional parameter count mismatch; base method has 4, but override has 2 (reportIncompatibleMethodOverride)
+     Positional parameter count mismatch; base method has 4, but override has 2
+       "GCMessage" is incompatible with "CacheSubscribedCheck" (reportIncompatibleMethodOverride)
-     Positional parameter count mismatch; base method has 3, but override has 2 (reportIncompatibleMethodOverride)
+     Positional parameter count mismatch; base method has 3, but override has 2
+       "Message" is incompatible with "ClientGetLegacyGameKeyResponse" (reportIncompatibleMethodOverride)
-     Positional parameter count mismatch; base method has 3, but override has 2 (reportIncompatibleMethodOverride)
+     Positional parameter count mismatch; base method has 3, but override has 2
+       "Message" is incompatible with "ClientGetFriendsWhoPlayGameResponse" (reportIncompatibleMethodOverride)
-     Parameter 2 name mismatch: base parameter is named "message", override parameter is named "arguments" (reportIncompatibleMethodOverride)
+     Parameter 2 name mismatch: base parameter is named "message", override parameter is named "arguments"
+       "Bot" is incompatible with "TheTestBot" (reportIncompatibleMethodOverride)
+       "ConverterBase[T_co@ConverterBase]" is incompatible with "MediaConverter"

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+       "tanjun.abc.Client" is incompatible with "tanjun.clients.Client"
+       "tanjun.abc.Component" is incompatible with "tanjun.components.Component"

Expression (https://github.com/cognitedata/Expression)
+     "MutableSequence[_T@MutableSequence]" is incompatible with "TypedArray[_TSource@TypedArray]"
+       "MutableSequence[_T@MutableSequence]" is incompatible with "TypedArray[_TSource@TypedArray]"

AutoSplit (https://github.com/Toufool/AutoSplit)
+     "dict[_KT@dict, _VT@dict]" is incompatible with "CaptureMethodDict"
-     Positional parameter count mismatch; base method has 3, but override has 2 (reportIncompatibleMethodOverride)
+     Positional parameter count mismatch; base method has 3, but override has 2
+       "dict[_KT@dict, _VT@dict]" is incompatible with "CaptureMethodDict" (reportIncompatibleMethodOverride)

@erictraut erictraut closed this Jun 14, 2023
@erictraut erictraut deleted the issue5288 branch June 14, 2023 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants