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

Invalid type signature for ActionRowBuilder.add_button #875

Closed
2 tasks done
tandemdude opened this issue Nov 3, 2021 · 0 comments · Fixed by #876
Closed
2 tasks done

Invalid type signature for ActionRowBuilder.add_button #875

tandemdude opened this issue Nov 3, 2021 · 0 comments · Fixed by #876
Labels
bug Something isn't working

Comments

@tandemdude
Copy link
Contributor

Steps to reproduce

  • Attempt to add a button to the builder passing in arguments with types ButtonStyle, str
  • Run mypy
  • Mypy throws an error that no overload variant matches the types passed in

Expected Result

Mypy should not throw an error as arguments of those types are valid.

Actual Result

nox > python -m mypy lightbulb
lightbulb/utils/nav.py: note: In member "build" of class "ComponentButton":
lightbulb/utils/nav.py:129:15: error: No overload variant of "add_button" of "ActionRowBuilder" matches argument types "ButtonStyle", "str"  [call-overload]
            btn = container.add_button(self.style, self.custom_id)
                  ^
lightbulb/utils/nav.py:129:15: note: Possible overload variants:
lightbulb/utils/nav.py:129:15: note:     def add_button(self, Union[Literal[ButtonStyle.PRIMARY], Literal[1], Literal[ButtonStyle.SECONDARY], Literal[2], Literal[ButtonStyle.SUCCESS], Literal[3], Literal[ButtonStyle.DANGER], Literal[4]], str) -> InteractiveButtonBuilder[ActionRowBuilder]
lightbulb/utils/nav.py:129:15: note:     def add_button(self, Union[Literal[ButtonStyle.LINK], Literal[5]], str) -> LinkButtonBuilder[ActionRowBuilder]
Found 1 error in 1 file (checked 31 source files)
nox > Command python -m mypy lightbulb failed with exit code 1
nox > Session mypy failed.

System info

hikari (2.0.0.dev103) [dc0f905a]
located at /Users/thommo/Development/hikari-lightbulb/venv/lib/python3.9/site-packages/hikari
CPython 3.9.6 Clang 12.0.5 (clang-1205.0.22.9)
Darwin Thommos-MacBook-Pro.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64 arm

Further info

Checklist

  • I have made sure to remove ANY sensitive information (bot token, passwords,
    credentials, personal details, etc).
  • I have searched the issue tracker and have made sure it's not a duplicate.
    If it is a follow up of another issue, I have specified it.
@tandemdude tandemdude added the bug Something isn't working label Nov 3, 2021
@davfsa davfsa self-assigned this Nov 3, 2021
@davfsa davfsa removed their assignment Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants