Skip to content

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

Description

@ParadeTo

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions