whereType<U> abstract method

  1. @useResult
Option<U> whereType<U>()

Returns a Some of the original value if this is a Some with a contained value of type U, or None otherwise.

Examples

// prints "Some(2)"
print(const Some(2).whereType<int>());

// prints "None"
print(const Some(2).whereType<bool>());

Implementation

@useResult
Option<U> whereType<U>();