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

local fields can alias each other #19

Open
lrytz opened this issue Jun 10, 2013 · 0 comments
Open

local fields can alias each other #19

lrytz opened this issue Jun 10, 2013 · 0 comments

Comments

@lrytz
Copy link
Owner

lrytz commented Jun 10, 2013

MutableList.scala has two local fields which alias each other, similar to the following:

  class Counter {
    private var x = 0
    def inc(): Int @pure @mod(this) = { x += 1; x }
  }

  class MUHA {
    @local var firstC = new Counter
    @local var lastC = firstC

    def f(): Counter @loc(this) = {
      lastC
    }
  }

the above should work. the below should not:

  class MUHA {
    var firstC = new Counter  // non-local
    @local var lastC = firstC  // should fail

    def f(): Counter @loc(this) = {
      lastC
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant