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

这里的打印结果应该是 0 #21

Open
ParadeTo opened this issue Feb 12, 2020 · 0 comments
Open

这里的打印结果应该是 0 #21

ParadeTo opened this issue Feb 12, 2020 · 0 comments

Comments

@ParadeTo
Copy link

因为在 type resolve 阶段已经把所有的变量定义都识别出来了,然后在 ref resolve 阶段解决分号中第一个 i 的引用时会在当前作用域中寻找到,所以分号中对 i 的赋值不会影响到根作用域的变量 i。运行了一下程序确实如此。

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

No branches or pull requests

1 participant