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

recheck types after obfuscation of literals #790

Closed
wants to merge 1 commit into from
Closed

Conversation

lu4p
Copy link
Member

@lu4p lu4p commented Aug 27, 2023

Fixes #649

EDIT: This works for simple cases. I don't want to investigate why the tests are failing as I don't think this is important enough to fix to warrant another typecheck.

@lu4p lu4p marked this pull request as draft August 27, 2023 22:15
@mvdan
Copy link
Member

mvdan commented Sep 23, 2023

Personally I don't think typechecking again from scratch is the right approach - it's far too expensive. Typechecking once is already slow enough :)

We could consider having the literals code update the type information as it changes the syntax tree. I'm not sure if that's feasible with go/types, and it might be a bit complex, but it would be faster for sure.

An alternative would be for the literal obfuscation to happen with the syntax tree alone - before we have typechecked. This would be the simplest fix, but it might also make literal obfuscation less useful in cases like "foo" + "bar".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Names inside generated lambdas are not obfuscated
2 participants