Trying to get this
type is incredibly unweildy. Ref: Self
from Rust
#4098
Labels
request
Requests to resolve a particular developer problem
Sometimes, I want to get "this" type. This is often side-stepped by the use of
covarient
in;for example;
didUpdateWidget(covarient ThisWidget oldWidget)
Additionally, I find myself occasionally wanting to do something like:
as a way to extract the "this" type, but it can get really messy really quickly.
One possible usecase is to have a copyWith interface as such:
To add on, this could have strong synergy with static interfaces, as we could then operate on
Self
such as doing:Granted, copyWith is likely not the strongest example for this, but its 2:30 am and I don't have an example on hand, on account of being forced to give up :/
I want to see what ideas others have with regards to the usefulness of a
Self
-like "type"The text was updated successfully, but these errors were encountered: