expect method
Unwraps an option, yielding the content of a Some
.
Throws an Exception
if the value is a None
, with the passed message.
Implementation
T expect(String msg) => toNullable() ?? (throw OptionUnwrapException<T>(msg));
Unwraps an option, yielding the content of a Some
.
Throws an Exception
if the value is a None
, with the passed message.
T expect(String msg) => toNullable() ?? (throw OptionUnwrapException<T>(msg));