expect method

T expect(
  1. String msg
)

Returns the contained Some value if Some, otherwise throws a Panic.

Implementation

@pragma("vm:prefer-inline")
T expect(String msg) {
  return v == null
      ? throw Panic("Called `expect` on a value that was `None`. $msg")
      : v!;
}