operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Compare equality between two Option values.

Option values are considered equal if the values they hold are equal, or if they hold references to the same object (identical()).

Note that None values are always equal to one another. Their T type is elided implicitly.

Implementation

@override
operator ==(Object other) => switch (other) {
	Some(:T v) when isSome() => identical(v, unwrap()) || v == unwrap(),
	None() when isNone() => true,
	_ => false
};