captureResultGeneric<T> method Null safety

  1. @internal
  2. @nonVirtual
T captureResultGeneric<T>(
  1. T callback(
    1. Parser<R> self
    )
)

Internal helper to capture the generic type R of the parse result from extension methods. This makes it possible to wrap the parser without loosing type information.

Implementation

@internal
@nonVirtual
T captureResultGeneric<T>(T Function<R>(Parser<R> self) callback) =>
    callback<R>(this);