roslyn:check_type_compatibility
Determine whether one C# type is assignable to another. Use before generating assignments or casts to verify compatibility and get 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') |