镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Assignment of if and switch to a variable. #398

Open

Description

@strait

The current code generated for this is potentially dangerous as it injects a name into a scope where the same name may have been re-declared as local.

Activity

  1. vendethiel commented on Aug 22, 2019

    @vendethiel

    The compiler is actually smart enough to not do that (you can try and stick _exp_0 = true before your assignment to switch and see what happens)

  2. strait commented on Aug 22, 2019

    @strait
    Author

    It's not that, it's this.

    i = if fflag
      1
    else
      local i
      i = 1
      while next(i)
        i += 1
      i

    It's also an issue with the do statement-as-expression being assigned.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions