-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 resulted in an incorrect type evaluation when access… #6419
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ing a property that returns `Self` or `type[Self]`.
Diff from mypy_primer, showing the effect of this PR on open source code: steam.py (https://github.com/Gobot1234/steam.py)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:201:31 - warning: Unnecessary "# type: ignore" comment
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:259:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
- Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:261:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
- Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:267:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
- Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:269:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
- Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:2132:16 - error: Expression of type "UserNewsType" cannot be assigned to return type "Self@UserNewsType"
- Type "UserNewsType" cannot be assigned to type "Self@UserNewsType" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/enums.py:2137:16 - error: Expression of type "UserNewsType" cannot be assigned to return type "Self@UserNewsType"
- Type "UserNewsType" cannot be assigned to type "Self@UserNewsType" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/manifest.py:249:32 - error: Argument of type "ManifestPath" cannot be assigned to parameter "__object" of type "Self@ManifestPath" in function "append"
- Type "ManifestPath" cannot be assigned to type "Self@ManifestPath" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/role.py
- /tmp/mypy_primer/projects/steam.py/steam/role.py:121:16 - error: Expression of type "RolePermissions" cannot be assigned to return type "Self@RolePermissions"
- Type "RolePermissions" cannot be assigned to type "Self@RolePermissions" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/ext/commands/bot.py:220:39 - error: Argument of type "Cog[Bot]" cannot be assigned to parameter "cog" of type "Cog[Self@Bot]" in function "remove_cog"
- "Cog[Bot]" is incompatible with "Cog[Self@Bot]"
- Type parameter "BotT@Cog" is covariant, but "Bot" is not a subtype of "Self@Bot"
- Type "Bot" cannot be assigned to type "Self@Bot" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/ext/commands/bot.py:294:39 - error: Argument of type "Cog[Bot]" cannot be assigned to parameter "cog" of type "Cog[Self@Bot]" in function "remove_cog"
- "Cog[Bot]" is incompatible with "Cog[Self@Bot]"
- Type parameter "BotT@Cog" is covariant, but "Bot" is not a subtype of "Self@Bot"
- Type "Bot" cannot be assigned to type "Self@Bot" (reportGeneralTypeIssues)
- 8421 errors, 22 warnings, 0 informations
+ 8411 errors, 23 warnings, 0 informations
discord.py (https://github.com/Rapptz/discord.py)
- /tmp/mypy_primer/projects/discord.py/discord/abc.py
- /tmp/mypy_primer/projects/discord.py/discord/abc.py:975:16 - error: Expression of type "GuildChannel" cannot be assigned to return type "Self@GuildChannel"
- Type "GuildChannel" cannot be assigned to type "Self@GuildChannel" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/embeds.py
- /tmp/mypy_primer/projects/discord.py/discord/embeds.py:252:16 - error: Expression of type "Embed" cannot be assigned to return type "Self@Embed"
- Type "Embed" cannot be assigned to type "Self@Embed" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/cooldowns.py
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/cooldowns.py:251:16 - error: Expression of type "MaxConcurrency" cannot be assigned to return type "Self@MaxConcurrency"
- Type "MaxConcurrency" cannot be assigned to type "Self@MaxConcurrency" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/core.py:618:48 - error: Argument of type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to parameter "other" of type "Self@Command[CogT@Command, P@Command, T@Command]" in function "_ensure_assignment_on_copy"
- Type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to type "Self@Command[CogT@Command, P@Command, T@Command]" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/core.py:625:52 - error: Argument of type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to parameter "other" of type "Self@Command[CogT@Command, P@Command, T@Command]" in function "_ensure_assignment_on_copy"
- Type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to type "Self@Command[CogT@Command, P@Command, T@Command]" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/help.py
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/help.py:377:16 - error: Expression of type "HelpCommand" cannot be assigned to return type "Self@HelpCommand"
- Type "HelpCommand" cannot be assigned to type "Self@HelpCommand" (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/parameters.py
- /tmp/mypy_primer/projects/discord.py/discord/ext/commands/parameters.py:138:16 - error: Expression of type "Parameter" cannot be assigned to return type "Self@Parameter"
- Type "Parameter" cannot be assigned to type "Self@Parameter" (reportGeneralTypeIssues)
- 69 errors, 9 warnings, 0 informations
+ 62 errors, 9 warnings, 0 informations
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ing a property that returns
Self
ortype[Self]
.