requireNoNulls method

KtList<T> requireNoNulls()

Returns an original collection containing all the non-null elements, throwing an ArgumentError if there are any null elements.

Implementation

KtList<T> requireNoNulls() {
  for (final element in iter) {
    if (element == null) {
      throw ArgumentError("null element found in $this.");
    }
  }
  return cast<T>();
}