Closed Irev-Dev closed 3 months ago
Bit more context on the likely cause here https://kittycadworkspace.slack.com/archives/C04KFV6NKL0/p1704948075061969
Should be solved by grackle anyway
i thought this might be a fun one for showing jon around @adamchalmers but no worries if not
Yeah I was thinking the same thing.
Yes, I'd love to tackle this! It's related to how you handle variable shadowing, and I need to get up to speed on some things. But this is definitely on my radar.
In the meantime, if you want to read about it, there's a chapter in the Crafting Interpreters book about solving this problem: https://craftinginterpreters.com/resolving-and-binding.html I'd be happy to give the high level summary. I'd like to first get more familiar with the modeling-app codebase so that I can find the relevant parts of the code.
I started to work on this. I know it's not assigned to me, but I figured that even if it doesn't get used, I'm learning a lot by attempting this.
Sounds perfect, I don't think it's actively under development anyway.
🚀
The following code creates a
Cannot redefine varShouldBeScoppedToFn
erroreven though this variable should be within the function scope
note the first call
const result = fnDef(2)
doesn't trigger itIt's the second one
const result2 = fnDef(4)
, must have something to do with the function call after the variable declaration.Here's a more minimal viable reproduction
Moving the variable declaration to the top still has the error