Skip to content

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

Merged
spytheman merged 6 commits into
vlang:masterfrom
Delta456:checker_warn_unused_imported_fns
Nov 4, 2023
Merged

spytheman merged 6 commits into
vlang:masterfrom
Delta456:checker_warn_unused_imported_fns

Conversation

@Delta456

@Delta456 Delta456 commented Nov 2, 2023 •

Copy link
Copy Markdown
Member

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

Delta456 commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

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
@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