Skip to content

local fields can alias each other #19

@lrytz

Description

@lrytz

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
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions