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

Insufficient conservatism when tracking aliases for abstract/polymorphic types #589

athas opened this issue Jul 14, 2018 · 1 comment


Copy link

commented Jul 14, 2018

This program fails after internalisation:

let swap 't (i: i32) (j: i32) (xs: *[]t) =
  let xs_i = xs[i]
  let xs[i] = xs[j]
  let xs[j] = xs_i
  in xs

let main (xs: *[][]i32) = swap 0 1 xs

The problem is that we currently do not alias xs_i to xs, but they really do alias once we replace the polymorphic type t with []i32.

The solution is to track aliases not just for arrays (as we currently do), but for everything that we are not certain is a primitive. I wonder if this will break any code.

@athas athas self-assigned this Jul 14, 2018

This comment has been minimized.

Copy link
Member Author

commented Jul 14, 2018

Note that I am not going to make this program work, I am just going to make it fail in the frontend type checker, rather than after internalisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.