isSameType<S, T> function

bool isSameType<S, T>()

Determines whether S is the same type as T.

isSameType<String, String>(); // true
isSameType<String?, String>(); // false

Implementation

bool isSameType<S, T>() {
  void func<X extends S>() {}
  return func is void Function<X extends T>();
}