dependencyErased property
Object? Function()
get
dependencyErased
dependency, viewed untyped as Object? Function().
Contravariance in Dart Pattern Matching
When pattern matching against case MemoNode(): in mount or render code,
Dart binds the generic type T as dynamic. Accessing builder through
an erased reference would cast it to BloomNode Function(dynamic), which
fails at runtime because Dart function parameters are contravariant:
a BloomNode Function(MyData) is not a subtype of BloomNode Function(dynamic).
This getter performs the cast (value as T) internally within MemoNode
where T is statically known, returning a closure that backend engines
can safely call without type errors.
Implementation
Object? Function() get dependencyErased => dependency;