# Subtypes · Chromia Docs (concept)

> In Rell, the concept of subtypes enhances code flexibility and reusability by allowing seamless assignment between compatible types.

Source: https://docs.chromia.com/rell/language-features/types/sub-types/

# Subtypes

In Rell, the concept of subtypes enhances code flexibility and reusability by allowing seamless assignment between
compatible types.

If type `B` is a subtype of type `A`, you can freely assign a value of type `B` to a variable of type `A` or pass it as
an argument to a function expecting type `A`.

### Common subtype relationships

* **Optional types**:
  + `T` is a subtype of `T?` (a non-nullable type is a subtype of its nullable counterpart).
  + `null` is a subtype of `T?` (null can be assigned to any nullable type).
* **Tuples**:
  + `(T, P)` is a subtype of `(T?, P?)`, `(T?, P)`, and `(T, P?)` (tuples with more specific types are subtypes of
    tuples with more general types).

[View this page on docs.chromia.com](https://docs.chromia.com/rell/language-features/types/sub-types/)Content mirrored from the live docs
