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

Proper Type Environments, Binders, and Assignments #76

Closed
jakzale opened this issue May 18, 2020 · 2 comments · Fixed by #78
Closed

Proper Type Environments, Binders, and Assignments #76

jakzale opened this issue May 18, 2020 · 2 comments · Fixed by #78
Assignees

Comments

@jakzale
Copy link
Collaborator

jakzale commented May 18, 2020

Adding this as a single issue, because it addresses the following bug:

Because the statement in the inner loop should have been an assignment, but instead it is a shadowing declaration, therefore renamer uncouples them. Furthermore, as we do not have proper binding rules for the for loop, type checker happily accepts this program, however the loop never gets evaluated, therefore the variable is never bound!

*** Failed! (after 646 tests and 23 shrinks):
        ERROR
          evaluation of the renamed program did not match the evaluation of the original program

        INITIAL STATE
          Env {unEnv = fromList [(26,Some 0)]}

        ORIGINAL PROGRAM
          for z_24 = 0 to -1 do
          let x_26 = x_26;
          end;
          let y_29 = if (0 == x_26) then 0 else 0;

        ORIGINAL PROGRAM FINAL STATE
          "[Some 0]"

        RENAMED PROGRAM
          for z_27 = 0 to -1 do
          let x_28 = x_26;
          end;
          let y_29 = if (0 == x_28) then 0 else 0;

        RENAMED PROGRAM FINAL STATE
          "VariableNotInScopeEvalError"
@effectfully
Copy link
Owner

effectfully commented Jun 11, 2020

Do we have a test where this program:

for z = 0 to -1 do
    let x = x;
end;
let y = if (0 == x) then 0 else 0;

gets compiled to the typed language, renamed and serialized to a golden file? If not, could you add it? Preferably before merging #78 in.

@jakzale
Copy link
Collaborator Author

jakzale commented Jun 15, 2020

Added in 21fe693

@jakzale jakzale linked a pull request Jul 8, 2020 that will close this issue
7 tasks
@jakzale jakzale removed a link to a pull request Jul 14, 2020
7 tasks
@jakzale jakzale linked a pull request Jul 14, 2020 that will close this issue
7 tasks
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

Successfully merging a pull request may close this issue.

2 participants