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

markused: fixing missing info tracking on walker #23008

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 29, 2024

Some fixes I've done detected by running --skip-unused on v.ui, vtl, vsl, ved etc.

  • Make walker visit more nodes (e.g. {...foo})
  • Handle function as global var
  • Load embeded struct definition
  • Load struct when used on []Struct
  • Load struct when used on map[k]Struct

Huly®: V_0.6-21449

@felipensp felipensp marked this pull request as ready for review November 29, 2024 19:28
@felipensp felipensp changed the title markused: update ast walker to new features markused: fixing missing info tracking on walkfer Nov 29, 2024
@felipensp felipensp changed the title markused: fixing missing info tracking on walkfer markused: fixing missing info tracking on walker Nov 29, 2024
@spytheman
Copy link
Member

Can you please also add some isolated examples in vlib/v/tests/skip_unused/ ?
Having it work for bigger projects is nice, but the sources of those can change, and it will be nice to have samples, that will continue to test that new functionality.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman
Copy link
Member

For me, ved compiles with -skip-unused on both master, and on this PR.

~/.vmodules/ui/examples/rectangles.v does not compile on both master and on this PR:
image

@spytheman
Copy link
Member

~/.vmodules/vsl/examples/diff_example/ also compiled on both master and here:
image

@spytheman spytheman merged commit 602b097 into vlang:master Nov 30, 2024
72 checks passed
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