roslyn:check_type_compatibility
Verify type compatibility for safe assignments and casts in C#/.NET code by checking if one type can be assigned to another, providing compatibility status and conversion details.
Instructions
Check if one type can be assigned to another. Use before generating assignments or casts.
USAGE: check_type_compatibility(sourceType="MyDerivedClass", targetType="MyBaseClass") OUTPUT: compatible (bool), requiresCast (bool), conversionKind, and explanation of why/why not.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceType | Yes | The source type name (e.g., 'MyDerivedClass') | |
| targetType | Yes | The target type name (e.g., 'MyBaseClass') |