isSubtypeOf method

  1. @override
bool isSubtypeOf(
  1. RuntimeType other, {
  2. Object? value,
})
override

Checks if this type is a subtype of other.

Implementation

@override
bool isSubtypeOf(RuntimeType other, {Object? value}) {
  final f1 = _function;
  if (other is NativeFunction) {
    final f2 = other._function;
    if (name == 'num') {
      final isSubtype = switch (other._name) {
        'num' => true,
        'int' => true,
        'double' => true,
        _ => false,
      };
      return isSubtype;
    }
    return f1 == f2;
  }

  return false;
}