Closed lu4p closed 10 months ago
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"
.
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.