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

Fixes (part 2) #149

Merged
merged 8 commits into from
Jun 24, 2024
Merged

Fixes (part 2) #149

merged 8 commits into from
Jun 24, 2024

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Jun 24, 2024

Following on from #148, this PR contains various fixes:

  • we now support generic type parameters that are structs
  • we now conservatively register type info for all function decls/lits in the module, and mark functions/methods in the module that contain function literals as noinline, in case they create a closure that needs to be serialized
  • tweaks the logging so it generates more useful output

Comment on lines +452 to +453
yes = true
return false
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand this statement, yes is the named return, which we set to true but then immediately override by returning false?

Copy link
Contributor Author

@chriso chriso Jun 24, 2024

Choose a reason for hiding this comment

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

ast.Inspect is an iterator that expects a function to return whether it wants to continue iteration in that part of the AST. Once we find a function literal, we return false to terminate iteration.

I copied the helper function from above and changed it slightly, since we're looking for any function literal, not just colored function literals.

Copy link
Contributor

Choose a reason for hiding this comment

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

😓 my bad, I misread this, thanks for the precision.

@chriso chriso merged commit 9fefde4 into main Jun 24, 2024
2 checks passed
@chriso chriso deleted the fixes2 branch June 24, 2024 19:43
@chriso chriso mentioned this pull request Jun 28, 2024
chriso added a commit that referenced this pull request Jun 28, 2024
Following on from #148 and #149, this PR contains various minor fixes:
* slices can now be used with generics
* struct tags are now supported
* lint warnings have been fixed
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