Skip to content

Omitting update in Mutable class fails to err under separation checking #24202

@rjolly

Description

@rjolly

Compiler version

3.8.0-RC1-bin-20251017-96aff06-NIGHTLY

Context

Experimenting with https://nightly.scala-lang.org/docs/reference/experimental/capture-checking/separation-checking.html

Minimized code

import language.experimental.{captureChecking, separationChecking}

class Ref(init: Int) extends scala.caps.Mutable:
  private var current = init
  def get: Int = current
  update def set(x: Int): Unit = current = x // no error if `update` is omitted

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