Skip to content

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

@noresttherein

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions