Skip to content

Consistently set defaults for new-based constructors #624

Closed
@yurique

Description

@yurique

MutationObserverInit is defined as a trait with vars and initial values, thus doing this won't compile:

new MutationObserverInit {
  val childList: UndefOr[Boolean] = someChildList
  ...

As a slight inconvenience, because the fields are initialized in the trait, the override modifier is required.
But what doesn't work is overriding the vars: scalac complains mutable variable cannot be overridden.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions