Skip to content

Whitelisting scala.collection.mutable.ObservableBuffer fails to compile. #1803

Closed
@nicolasstucki

Description

@nicolasstucki

Whitelisting scala/collection/mutable/ObservableBuffer.scala will fail with:

73 |    })
   |     ^
   |     found:    scala.collection.script.Reset with scala.collection.mutable.Undoable{...}
   |     required: scala.collection.script.Message[A] & scala.collection.mutable.Undoable

where

trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoable] {
  ...
  abstract override def clear(): Unit = {
    super.clear()
    publish(new Reset with Undoable {
      def undo() { throw new UnsupportedOperationException("cannot undo") }
    })
  }
  ...
}

case class Reset[+A]() extends Message[A]

if the Reset (i.e. publish(new Reset[A] with Undoable {...) type parameter is added explicitly it compiles. It looks like the type parameter of Reset is not inferred.

The same applies for scala/collection/mutable/ObservableMap.scala, scala/collection/mutable/ObservableSet.scala

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions