isValueCompatibleWithTypeArgument method
Check if a value is compatible with the expected generic type at the given index
Implementation
bool isValueCompatibleWithTypeArgument(Object? value, int typeArgumentIndex) {
if (typeArguments == null || typeArgumentIndex >= typeArguments!.length) {
// No type constraints, allow any value
return true;
}
final expectedType = typeArguments![typeArgumentIndex];
return _isValueCompatibleWithType(value, expectedType);
}