Intersection type
Summary
In type theory, an intersection type can be allocated to values that can be assigned both the type and the type . This value can be given the intersection type in an intersection type system. Generally, if the ranges of values of two types overlap, then a value belonging to the intersection of the two ranges can be assigned the intersection type of these two types. Such a value can be safely passed as argument to functions expecting either of the two types. For example, in Java the class Boolean implements both the Serializable and the Comparable interfaces. Therefore, an object of type Boolean can be safely passed to functions expecting an argument of type Serializable and to functions expecting an argument of type Comparable.
Further reading
- Wikipedia, page 24140211, revision 1374885617, Intersection type. adopted
About this page
| Tag | R4PQ6VXER6 |
|---|---|
| URI | m2://R4PQ6VXER6 |
| Aliases | comparison-of-languages-with-intersection-types, comparison-of-programming-languages-intersection-types |
| Kind | concept |
| Writing | W1 stated |
| Same as | |
| Changed | 4 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W2
- edge defines in: at least one definition (0 of 1)
- edge instance_of in: at least two examples (0 of 2)
- edge not_instance_of in: at least one non-example (0 of 1)
- edge specializes both: the more general notions and the special cases (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.