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

lifted.freeVariables: Don't overload by type, assert equality #227

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

marzipankaiser
Copy link
Contributor

This changes lifted.freeVariables to compare variables by id only. It, however, asserts equality for the params, too (They should be consistent).

Note: This makes the following example from #225 crash:

effect Increment {
  def increment(): Unit
}
def main() = {
  try {

    def step(): Int = {
        def looper(): Int / Increment = 0
        looper()
    }

    step()
  } with Increment {
      def increment() = resume(())
  }
}

This is a good thing, as this makes a bug in PolymorphismBoxing obvious.

@b-studios
Copy link
Collaborator

Could you add the example as a test? This way we can avoid reintroducing the bug.

This changes `lifted.freeVariables` to compare variables by `id` only.
It, however, asserts equality for the params, too (They should be
consistent).
@marzipankaiser marzipankaiser merged commit c71418c into master Feb 9, 2023
@b-studios b-studios deleted the bugfix/lifted-freeVariables branch January 28, 2024 11:53
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 this pull request may close these issues.

None yet

2 participants