Skip to content

"Illegal aliasing of aliased local variable" when there is no aliasing involved #1270

@mario-bucev

Description

@mario-bucev

AntiAliasing complains that b is aliased when calling inner:

object InnerFnsAliasing {
  case class Box(var value: Int)

  def outer(b: Box): Unit = {
    def inner(v: Int): Unit = {
      require(b.value == v)
    }
    inner(b.value) // Illegal passing of aliased local variable: b
  }
}

Here, we are passing a value of an immutable type to inner, as such, b is not aliased.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions