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

parser: warn on unused imported functions used via import math { sin, cos } #19738

Merged
merged 6 commits into from
Nov 4, 2023

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Nov 2, 2023

Fixes #17432

🤖 Generated by Copilot at 1d993db

This pull request fixes some issues with the checker's detection of unused imports in the parser. It adds or removes import registrations for modules that contain functions or types that are used or unused in the file. It also adds a test case for the unused import warning.

🤖 Generated by Copilot at 1d993db

  • Register imported modules that contain used functions or types to avoid checker warnings (link, link)
  • Remove unnecessary registration of imported module that is aliased (link)
  • Add test case for checker warning on importing unused symbols from a module (link, link)

@Delta456 Delta456 marked this pull request as draft November 2, 2023 14:38
@Delta456 Delta456 changed the title checker: warn on unused imported functions used via import math { sin, cos } parser: warn on unused imported functions used via import math { sin, cos } Nov 2, 2023
@Delta456
Copy link
Member Author

Delta456 commented Nov 2, 2023

Special thanks to @spytheman for helping to solve the issue effectively!

@Delta456 Delta456 marked this pull request as ready for review November 4, 2023 16:01
@spytheman spytheman merged commit 14afda7 into vlang:master Nov 4, 2023
54 checks passed
@Delta456 Delta456 deleted the checker_warn_unused_imported_fns branch November 4, 2023 17:51
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.

No warning when not using functions from imported module.
2 participants