AnyDistanceFunction typedef

num AnyDistanceFunction (
  1. Null a,
  2. Null b

The type of a union of instances of DistanceFunction<T> for various types T.

This type is used to describe a collection of DistanceFunction<T> functions which have (potentially) unrelated argument types. Since the argument types of the functions may be unrelated, the only thing that the type system can statically assume about them is that they accept null (since all types in Dart are nullable).

Calling an instance of this type must either be done dynamically, or by first casting it to a DistanceFunction<T> for some concrete T.


typedef AnyDistanceFunction = num Function(Null a, Null b);