> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Type conversion

> Implicit type conversion in the FlexiLayout language: safe conversions like Int to Real, plus coordinate-distance conversions with compiler warnings.

The FlexiLayout language supports implicit type conversion. Some conversions are always safe, while others are allowed but can fail at runtime and cause the compiler to display a warning.

## Safe implicit conversions

The following conversions are always safe.

| Source type   | Target type    |
| :------------ | :------------- |
| `Int`         | `Real`         |
| `Rect`        | `Region`       |
| `XCoordinate` | `XInterval`    |
| `YCoordinate` | `YInterval`    |
| `Distance`    | `DistInterval` |

## Conversions that may cause errors

The following conversions are allowed but can produce a runtime error. For example, converting `XCoordinate` to `Distance` and then `Distance` to `YCoordinate` can incorrectly convert an X-coordinate into a Y-coordinate.

The compiler displays a warning when you use any of these conversions.

| Source type    | Target type    |
| :------------- | :------------- |
| `Distance`     | `XCoordinate`  |
| `Distance`     | `YCoordinate`  |
| `XCoordinate`  | `Distance`     |
| `YCoordinate`  | `Distance`     |
| `DistInterval` | `XInterval`    |
| `DistInterval` | `YInterval`    |
| `Xinterval`    | `DistInterval` |
| `Yinterval`    | `DistInterval` |
