Version
Types
Common ancestor type
A common ancestor type is a type computed for a list of types using the following algorithm:
- Add
NONEto the list of types (to make sure the list is never empty). - If there is a separate type in the list, add a mark
separatein front of all non-separate types in the list. - If there is a detachable type in the list, add a mark
detachablein front of all attached types in the list. - If there is a type in the list to which all other types conform, it is the common ancestor type.
- Otherwise, add
ANYto the list and repeat steps starting from step #2.
Here are some examples:
| Type list | Common ancestor type |
|---|---|
| (empty) | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
Back to Quick Reference
