Skip to content

Whitelisting scala.sys.BooleanProp crashes the compiler. #1789

Closed
@nicolasstucki

Description

@nicolasstucki

If scala/sys/BooleanProp.scala is added to the whitelist scala-collections.whitelist the with

dotty.tools.dotc.reporting.diagnostic.messages$Error: method clear is already defined as getter clear: ()scala.runtime.BoxedUnit

ConstantImpl is implementing clear, enable, disable, toggle and fails on each one.

class ConstantImpl(val key: String, val value: Boolean) extends BooleanProp {
    ...
    val clear, enable, disable, toggle = ()
    ...
  }

where

trait BooleanProp extends Prop[Boolean] {
  def enable(): Unit
  def disable(): Unit
  def toggle(): Unit
}

If the code in ConstantImpl is replaced with defs for each member it fixes the issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions