Okay so I have a class: ```class ElementRemoveEven...
# announcements
a
Okay so I have a class:
Copy code
class ElementRemoveEvent<E>(
    val element: E,
    override val collection: ObservableCollection<E>
) : Event<E>
And it is misbehaving as you can see in the screen shots, what is causing this and how do I get rid of it? Is it outcome of excessive type inference?
I have tried Invalidating Caches and Restart, that doesn't seem to solve this.
t
It's hard to say, but from the code snippet i guess that you need to add
@ObservableCollection
behind the
this
in your minus call
(better version below)
right now you're creating a new collection that contains all elements of backup minus the coroutine scope, which I guess is not what you want. I guess this also messes up the type of your
element
and by that also the
ElementRemoveEvent
generic type
after taking a closer look: replace
this
with
backingSource
in the
minus
call
a
Ahh, thanks! Didn't noticed that CoroutineScope was sent as an element to minus.
👍🏻 1