Skip to content

'Fields cannot be volatile' on a var constructor parameter in presence of default parameters #13180

Description

@noresttherein

Reproduction steps

Scala version:2.13.16

abstract class Field(@(volatile @field) private[this] var x :Int = 0)(y :Int = 10)

Problem

[error] C:\Users\turin\porn\test\src\main\scala\Test.scala:87:59: values cannot be volatile
[error] abstract class Field(@(volatile @field) private[this] var x :Int = 0)(y :Int = 10)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions