roslyn:check_type_compatibility
Check if a source type is assignable to a target type in C#. Use this tool to determine compatibility before generating assignments or casts, avoiding compile errors.
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') |